home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / DOSREF33.ZIP / CHAPTER.004 < prev    next >
Text File  |  1994-01-20  |  228KB  |  4,535 lines

  1.  
  2.    **  Programmer's Technical Reference for MSDOS and the IBM PC **
  3.             USA copyright TXG 392-616  ALL RIGHTS RESERVED
  4.  ──────────────────────────┤ DOSREF (tm) ├───────────────────────────
  5.                  ISBN 1-878830-02-3 (disk-based text)
  6.                 Copyright (c) 1987, 1994 Dave Williams
  7.                    ┌─────────────────────────────┐
  8.                    │ Shareware Version, 01/20/94 │
  9.                    │  Please Register Your Copy  │
  10.                    └─────────────────────────────┘
  11.  
  12.                        C H A P T E R    F O U R
  13.  
  14.  
  15.                    DOS INTERRUPTS AND FUNCTION CALLS
  16.  
  17.  
  18.                             C O N T E N T S
  19.  
  20. General Programming Guidelines .................................. 4**1
  21. DOS Registers ................................................... 4**2
  22. DOS Stacks ...................................................... 4**3
  23. DOS Interrupts .................................................. 4**4
  24. Interrupt 20h (Terminate) ....................................... 4**5
  25. DOS Services (quick list) ....................................... 4**6
  26. Calling the DOS Services ........................................ 4**7
  27. Version Specific Information .................................... 4**8
  28. Compatibility Problems With DOS 4.0+ ............................ 4**9
  29. PCjr Cartridge Support .......................................... 4**10
  30. eDOS 4.0 ........................................................ 4**11
  31. DOS Services in Detail .......................................... 4**12
  32.  
  33.  
  34. General Programming Guidelines .................................. 4**1
  35.  
  36.   Microsoft recommends avoiding the "old style" DOS 1.0 (01h-0Ch and
  37. 26h) system calls wherever possible.  Programmers are urged to use the
  38. "new style" (DOS 2.0+) handle calls instead.
  39.  
  40.   Do not use "undocumented" functions unless they are critical to your
  41. application and no other reasonable workaround can be found.  Remember
  42. that your programs may have to run under various versions of DOS, DOS
  43. clones such as Digital's DR-DOS, the OS/2 Compatibility Box, or Unix
  44. DOS Emulation Window.  Such environments or OS simulations do not
  45. always implement the undocumented calls.
  46.  
  47.   DOS 2.x and 3.x lack many of the enhancements found in later
  48. versions.  Your application should check the minimum required DOS
  49. version when specific features are required.  Do not test for a higher
  50. version than necessary or you will cause problems for machines running
  51. older versions of DOS, such as business machines which are seldom
  52. upgraded, laptops with DOS in ROM, etc.
  53.  
  54.   Direct disk access via hardware or the BIOS should be avoided
  55. unless your program will only be run on specific hardware or under
  56. certain circumstances.  Some versions of DOS 2.x treat their disks in
  57. a manner much like 3.x.  Some vendors added multiple DOS partitions or
  58. oversize drive support prior to the "official" 3.3 release.  Not all
  59. these systems work in the same way!  New-type SCSI or ESDI hard disk
  60. controllers do not always emulate all the standard BIOS calls.
  61.  
  62.  
  63. DOS Registers ................................................... 4**2
  64.  
  65.  DOS uses the following registers, pointers, and flags when it executes
  66. interrupts and function calls:
  67.  
  68. ┌──────────────────┬────────┬─────────────────────────────────────────┐
  69. │GENERAL REGISTERS │register│               definition                │
  70. │                  ├────────┼─────────────────────────────────────────┤
  71. │                  │   AX   │  accumulator                   (16 bit) │
  72. │                  │   AH   │  accumulator high-order byte   ( 8 bit) │
  73. │                  │   AL   │  accumulator low order byte    ( 8 bit) │
  74. │                  │   BX   │  base                          (16 bit) │
  75. │                  │   BH   │  base high-order byte          ( 8 bit) │
  76. │                  │   BL   │  base low-order byte           ( 8 bit) │
  77. │                  │   CX   │  count                         (16 bit) │
  78. │                  │   CH   │  count high order byte         ( 8 bit) │
  79. │                  │   CL   │  count low order byte          ( 8 bit) │
  80. │                  │   DX   │  data                          (16 bit) │
  81. │                  │   DH   │  date high order byte          ( 8 bit) │
  82. │                  │   DL   │  data low order byte           ( 8 bit) │
  83. ├──────────────────┼────────┼─────────────────────────────────────────┤
  84. │SEGMENT REGISTERS │register│               definition                │
  85. │                  ├────────┼─────────────────────────────────────────┤
  86. │                  │   CS   │  code  segment (16 bit)                 │
  87. │                  │   DS   │  data  segment (16 bit)                 │
  88. │                  │   SS   │  stack segment (16 bit)                 │
  89. │                  │   ES   │  extra segment (16 bit)                 │
  90. ├──────────────────┼────────┼─────────────────────────────────────────┤
  91. │INDEX REGISTERS   │register│               definition                │
  92. │                  ├────────┼─────────────────────────────────────────┤
  93. │                  │   DI   │  destination index (16 bit)             │
  94. │                  │   SI   │  source      index (16 bit)             │
  95. ├──────────────────┼────────┼─────────────────────────────────────────┤
  96. │POINTERS          │register│               definition                │
  97. │                  ├────────┼─────────────────────────────────────────┤
  98. │                  │   SP   │  stack       pointer (16 bit)           │
  99. │                  │   BP   │  base        pointer (16 bit)           │
  100. │                  │   IP   │  instruction pointer (16 bit)           │
  101. ├──────────────────┴────────┴─────────────────────────────────────────┤
  102. │FLAGS               AF, CF, DF, IF, OF, PF, SF, TF, ZF               │
  103. └─────────────────────────────────────────────────────────────────────┘
  104.  
  105.   These registers, pointers, and flags all work on the "lowest common
  106. denominator" 8088-8086 CPU.  DOS makes no attempt to use any of the
  107. special or enhanced instructions available on the later CPUs which will
  108. execute 8088 code, such as the 80186, 80286, 80386, or NEC V20, V30,
  109. V40, or V50.
  110.  
  111.   User registers except AX are preserved unless information is passed
  112. back to the register as indicated in specific function calls.
  113.  
  114.   For PC-MOS/386 on a 386 CPU, the task switching logic saves the
  115. upper half of the 32-bit registers and the complete FS and GS
  116. registers.
  117.  
  118.   The Intel 8088 processors supplied for the early IBM PCs were
  119. defective and did not handle the stack register properly on an INT
  120. instruction.  DOS 2.1 added extra logic around interrupt calls for
  121. stack handling; this is the major difference between 2.0 and 2.1.
  122.  
  123.  
  124. DOS Stacks ...................................................... 4**3
  125.  
  126.   When DOS takes control after a function call, it switches to an
  127. internal stack.  Registers which are not used to return information
  128. (other than AX) are preserved.  The calling program's stack must be
  129. large enough to accomodate the interrupt system - at least 128 bytes
  130. in addition to other interrupts.
  131.  
  132.  DOS actually maintains three stacks -
  133.  
  134. stack 1: 384 bytes (in DOS 3.1)
  135.          for functions 00h and for 0Dh and up, and for ints 25h and
  136.          26h.
  137.  
  138. stack 2: 384 bytes (in DOS 3.1)
  139.          for function calls 01h through 0Ch.
  140.  
  141. stack 3: 48 bytes (in DOS 3.1)
  142.          for functions 0Dh and above.  This stack is the initial stack
  143.          used by the int 21h handler before it decides which of the
  144.          other two to use.  It is also used by function 59h (get
  145.          extended error), and 01h to 0Ch if they are called during an
  146.          int 24h (critical error) handler.  Functions 33h (get/set
  147.          break flag), 50h (set process ID), 51h (get process ID) and
  148.          62h (get PSP address) do not use any DOS stack under DOS 3.x
  149.          (under 2.x, 50h and 51h use stack number 2).
  150.  
  151.   IBM and Microsoft made a change back in DOS 3.0 or 3.1 to reduce the
  152. size of DOS.  They reduced the space allocated for scratch areas when
  153. interrupts are being processed.  The default seems to vary with the
  154. DOS version and the machine, but 8 stack frames seems to be common.
  155. That means that if you get more than 8 interrupts at the same time,
  156. clock, disk, printer spooler, keyboard, com port, etc., the system will
  157. crash.  It usually seems to happen on a network.
  158.  
  159.   DOS 3.2 does some different stack switching than previous versions.
  160. The interrupts which are switched are 02h, 08h, 09h, 0Ah, 0Bh, 0Ch,
  161. 0Dh, 0Eh, 70h, 72h, 73h, 74h, 75h, 76h, and 77h.  DOS 3.2 has a
  162. special check in the initialization code for a PCjr and don't enable
  163. stack switching on that machine.  DOS 3.3 was changed so that no stack
  164. switching occurs on PC, PC-XT, or the PC Portable, and defaults to 9
  165. stacks of 128 bytes in an AT.
  166.  
  167.   Additional stacks can be allocated when DOS loads by using the
  168. STACKS= command in CONFIG.SYS.  These stacks are in addition to the
  169. 3 internal DOS stacks.  STACKS=16,256 means allow 16 interrupts to
  170. interrupt each other and allow 256 bytes for each for scratch area.
  171.  
  172.  
  173. DOS Interrupts .................................................. 4**4
  174.  
  175.   Microsoft recommends that a program wishing to examine or set the
  176. contents of any interrupt vector use the DOS function calls 35h and
  177. 25h provided for those purposes and avoid referencing the interrupt
  178. vector locations directly.
  179.  
  180.   DOS reserves interrupt numbers 20h to 3Fh for its own use.  This
  181. means absolute memory locations 80h to 0FFh are reserved by DOS.
  182.  
  183.  
  184.  
  185. Interrupt 20h - Terminate Current Program ....................... 4**5
  186.  
  187. (0:0080h)
  188.   Issue int 20h to exit from a program.  This vector transfers to the
  189. logic in DOS to restore the terminate address, the Ctrl-Break address,
  190. and the critical error exit address to the values they had on entry to
  191. the program.  All the file buffers are flushed and all handles are
  192. closed.  You should close all files changed in length (see function
  193. calls 10h and 3Eh) before issuing this interrupt.  If the changed file
  194. is not closed, its length, time, and date are not recorded correctly
  195. in the directory.
  196.  
  197.   This call is intended for use with .COM programs only.
  198.  
  199.   For a program to pass a completion code or an error code when
  200. terminating, it must use either function call 4Ch (Terminate a
  201. Process) or 31h (Terminate Process and Stay Resident).  These two
  202. methods are preferred over using int 20h and the codes returned by
  203. them can be interrogated in batch processing.
  204.  
  205. Important: Before you issue an interrupt 20h, your program must
  206.            ensure that the CS register contains the segment of its
  207.            Program Segment Prefix.
  208.  
  209. Interrupt 20h   DOS - Terminate Program
  210. entry   no parameters
  211. return  The following vectors are restored from the Program Segment
  212.         Prefix:
  213.         PSP offset  interrupt  description
  214.             0Ah        22h     Program Terminate
  215.             0Eh        23h     Control-C
  216.             12h        24h     Critical Error
  217. note 1) IBM and Microsoft recommend using int 21h Fn 4Ch.  Using int
  218.         20h is officially frowned upon since the introduction of DOS
  219.         2.0.
  220.      2) In DOS 3.2 at least, int 20h merely calls int 21h, fn 00h.
  221.      3) Supported by PC-MOS/386.
  222.  
  223.  
  224.  
  225. DOS Services (quick list) ....................................... 4**6
  226.  
  227. ┌────────────────────────────────────────────────────────────────────┐
  228. │Interrupt 21h  Function Call Request                                │
  229. └────────────────────────────────────────────────────────────────────┘
  230. (0:0084h)
  231.   DOS provides a wide variety of function calls for character device 
  232. I/O, file management, memory management, date and time functions,
  233. execution of other programs, and more.  They are grouped as follows: 
  234.  
  235.           call              description
  236.         00h           program terminate
  237.         01h-0Ch       character device I/O, CP/M compatibility format
  238.         0Dh-24h       file management,      CP/M compatibility format
  239.         25h-26h       nondevice functions,  CP/M compatibility format
  240.         27h-29h       file management,      CP/M compatibility format
  241.         2Ah-2Eh       nondevice functions,  CP/M compatibility format
  242.         2Fh-38h       extended functions
  243.         39h-3Bh       directory group
  244.         3Ch-46h       extended file management
  245.         47h           directory group
  246.         48h-4Bh       extended memory management
  247.         54h-57h       extended functions
  248.         5Eh-5Fh       networking
  249.         60h-62h       extended functions
  250.         63h-66h       enhanced foreign language support
  251.  
  252.  
  253. List of DOS services:   * = undocumented
  254.         00h     terminate program
  255.         01h     get keyboard input
  256.         02h     display character to STDIO
  257.         03h     get character from STDAUX
  258.         04h     output character to STDAUX
  259.         05h     output character to STDPRN
  260.         06h     direct console I/O - keyboard to screen
  261.         07h     get char from std I/O without echo
  262.         08h     get char from std I/O without echo, checks for ^C
  263.         09h     display a string to STDOUT
  264.         0Ah     buffered keyboard input
  265.         0Bh     check STDIN status
  266.         0Ch     clear keyboard buffer and invoke keyboard function
  267.     o   0Dh     flush all disk buffers
  268.     o   0Eh     select disk
  269.         0Fh     open file with File Control Block
  270.         10h     close file opened with File Control Block
  271.         11h     search for first matching file entry
  272.         12h     search for next matching file entry
  273.         13h     delete file specified by File Control Block
  274.         14h     sequential read from file specified by File Control
  275.                 Block
  276.         15h     sequential write to file specified by File Control
  277.                 Block
  278.         16h     find or create firectory entry for file
  279.         17h     rename file specified by file control block
  280.         18h*    unknown
  281.     o   19h     return current disk drive
  282.     o   1Ah     set disk transfer area (DTA)
  283.         1Bh     get current disk drive FAT
  284.         1Ch     get disk FAT for any drive
  285.         1Dh*    unknown
  286.         1Eh*    unknown
  287.         1Fh     read DOS disk block, default drive
  288.         20h*    unknown
  289.         21h     random read from file specified by FCB
  290.         22h     random write to file specified by FCB
  291.         23h     return number of records in file specified by FCB
  292.         24h     set relative file record size field for file specified
  293.                 by FCB
  294.     o   25h     set interrupt vector
  295.         26h     create new Program Segment Prefix (PSP)
  296.         27h     random file block read from file specified by FCB
  297.         28h     random file block write to file specified by FCB
  298.         29h     parse the command line for file name
  299.     o   2Ah     get the system date
  300.     o   2Bh     set the system date
  301.     o   2Ch     get the system time
  302.     o   2Dh     set the system time
  303.     o   2Eh     set/clear disk write VERIFY
  304.     o   2Fh     get the Disk Transfer Address (DTA)
  305.     o   30h     get DOS version number
  306.         31h     TSR, files opened remain open
  307.         32h     read DOS Disk Block
  308.     o   33h     get or set Ctrl-Break
  309.         34h     INDOS  Critical Section Flag
  310.     o   35h     get segment and offset address for an interrupt
  311.     o   36h     get free disk space
  312.         37h*    get/set option marking character (SWITCHAR)
  313.     o   38h     return country-dependent information
  314.     o   39h     create subdirectory
  315.     o   3Ah     remove subdirectory
  316.     o   3Bh     change current directory
  317.     o   3Ch     create and return file handle
  318.     o   3Dh     open file and return file handle
  319.     o   3Eh     close file referenced by file handle
  320.     o   3Fh     read from file referenced by file handle
  321.     o   40h     write to file referenced by file handle
  322.     o   41h     delete file
  323.     o   42h     move file pointer (move read-write pointer for file)
  324.     o   43h     set/return file attributes
  325.     o   44h     device IOCTL (I/O control) info
  326.     o   45h     duplicate file handle
  327.     o   46h     force a duplicate file handle
  328.     o   47h     get current directory
  329.     o   48h     allocate memory
  330.     o   49h     release allocated memory
  331.     o   4Ah     modify allocated memory
  332.     o   4Bh     load or execute a program
  333.     o   4Ch     terminate prog and return to DOS
  334.     o   4Dh     get return code of subprocess created by 4Bh
  335.     o   4Eh     find first matching file
  336.     o   4Fh     find next matching file
  337.         50h*    set new current Program Segment Prefix (PSP)
  338.         51h*    puts current PSP into BX
  339.         52h*    pointer to the DOS list of lists
  340.         53h*    translates BPB (Bios Parameter Block, see below)
  341.     o   54h     get disk verification status (VERIFY)
  342.         55h*    create PSP: similar to function 26h
  343.     o   56h     rename a file
  344.     o   57h     get/set file date and time
  345.         58h     get/set allocation strategy             (DOS 3.x)
  346.     o   59h     get extended error information
  347.     o   5Ah     create a unique filename
  348.     o   5Bh     create a DOS file
  349.     o   5Ch     lock/unlock file contents
  350.         5Dh     DOS internal functions
  351.         5Eh*    network printer
  352.         5Fh*    network redirection
  353.         60h*    parse pathname (TRUENAME)
  354.         61h*    unknown
  355.         62h     get program segment prefix (PSP)
  356.         63h*    get lead byte table                     (DOS 2.25)
  357.         64h*    unknown
  358.         65h     get extended country information        (DOS 3.3)
  359.         66h     get/set global code page table          (DOS 3.3)
  360.         67h     set handle count                        (DOS 3.3)
  361.         68h     commit file                             (DOS 3.3)
  362.         69h     disk serial number                      (DOS 4.0)
  363.         6Ah     unknown
  364.         6Bh     unknown
  365.         6Ch     extended open/create                    (DOS 4.0)
  366.  
  367.   Items marked with 'o' are explicitly supported in the OS/2 1.x DOS
  368. Compatibility Box, according to Microsoft.  Most everything is 
  369. supported in the OS/2 2.0 Virtual DOS Machine, according to IBM.
  370.  
  371.  
  372. Calling the DOS Services ........................................ 4**7
  373.  
  374.   The DOS services are invoked by placing the number of the desired
  375. function in register AH, subfunction in AL, setting the other
  376. registers to any specific requirements of the function, and invoking
  377. int 21h.
  378.  
  379.   When the interrupt is called, all register and flag values are 
  380. pushed into the stack.  Int 21h contains a pointer into an absolute 
  381. address in the IBMDOS.COM file.  This address is the main loop for the 
  382. DOS command handler.  The handler pops the register values, compares 
  383. them to its list of functions, and executes the function if valid.  
  384. When the function is complete, it may pass values back to the command 
  385. handler. The handler will push the values into the stack and then 
  386. return control to the calling program. 
  387.  
  388.   Most functions will return an error code; some return more
  389. information.  Details are contained in the listings for the individual
  390. functions.  Extended error return codes for most functions may be
  391. obtained by calling function 59h.
  392.  
  393.   Register settings listed are the ones used by DOS.  Some functions
  394. will return with garbage values in unused registers.  Do not test for
  395. values in unspecified registers; your program may exhibit odd behavior.
  396.  
  397.   DS:DX pointers are the data segment register (DS) indexed to the DH
  398. and DL registers (DX).  DX always contains the offset address, DS
  399. contains the segment address.
  400.  
  401.   The File Control Block services (FCB services) were part of DOS 1.0.
  402. Since the release of DOS 2.0, Microsoft has recommended that these
  403. services not be used.  A set of considerably more enhanced services
  404. (handle services) were introduced with DOS 2.0.  The handle services
  405. provide support for wildcards and subdirectories, and enhanced error
  406. detection via function 59h.  The FCB calls  also do not support the
  407. sharing modes or file locking functions of the handle calls, making
  408. them unsafe for use with networks or multitaskers.
  409.  
  410.   The data for the following calls was compiled from various Intel,
  411. Microsoft, IBM, and other publications.  There are many subtle
  412. differences between MSDOS and PCDOS and between the individual
  413. versions.  Differences between the versions are noted as they occur.
  414.  
  415.   There are various ways of calling the DOS functions.  For all
  416. methods, the function number is loaded into register AH, subfunctions
  417. and/or parameters are loaded into AL or other registers, and call int
  418. 21h by one of the following methods:
  419.  
  420.  A) call interrupt 21h directly  (the recommended procedure)
  421.  B) perform a long call to offset 50h in the program's PSP.
  422.      1) This method will not work under DOS 1.x.
  423.      2) Though recommended by Microsoft for DOS 2.0, this method takes
  424.         more time and is no longer recommended.
  425.  C) place the function number in CL and perform an intrasegment call
  426.     to location 05h in the current code segment.  This location
  427.     contains a long call to the DOS function dispatcher.
  428.      1) IBM recommends this method be used only when using existing
  429.         programs written for different calling conventions.  (such as
  430.         converting CP/M programs).  This method should be avoided
  431.         unless you have some specific use for it.
  432.      2) AX is always destroyed by this method.
  433.      3) This method is valid only for functions 00h-24h.
  434.  D) PC-MOS/386' virtualization scheme results in 200-400+ clocks per
  435.     interrupt when run on an 80286 machine since it has to flip in and
  436.     out of protected mode at CPU ring 0.  TSL recommends the following
  437.     procedure for apps that must run quickly on 286 machines:
  438.        1) PUSHF
  439.        2) CLI
  440.        3) CALL DWORD PTR[vector-contents]
  441.     This avoids flipping in and out of protected mode and the attendant
  442.     overhead.  However, TSL specifies this technique should not be used
  443.     with native-mode MOS applications.
  444.  
  445.  
  446.   There are also various ways of exiting from a program. (assuming it
  447. is not intended to be a TSR).  All methods except call 4Ch must ensure
  448. that the segment register contains the segment address of the PSP.
  449.  
  450.  A) Interrupt 21h, function 4Ch (Terminate with Result Code). This is
  451.     the "official" recommended method of returning to DOS.
  452.  B) Interrupt 21h, function 00h (Exit Program).  This is the early
  453.     style int 21h function call.  It simply calls int 20h.
  454.  C) Interrupt 20h (Exit).
  455.  D) A JMP instruction to offset 00h (int 20h vector) in the Program
  456.     Segment Prefix.  This is just a roundabout method to call int 20h.
  457.     This method was set up in DOS 1.0 for ease of conversion for CP/M
  458.     programs.  It is no longer recommended for use.
  459.  E) A JMP instruction to offset 05h (int 21 vector) in the Program
  460.     Segment Prefix, with AH set to 00h or 4Ch.  This is another CP/M
  461.     type function.
  462.  
  463.  
  464.  
  465. Version Specific Information .................................... 4**8
  466.  
  467. * Function Calls:
  468.  
  469.         DOS 2.x  supports function calls 00h to 57h.
  470.                 
  471.         DOS 2.25 is the only version to support function 63h
  472.                  (foreign keyboard)
  473.  
  474.         DOS 3.x  has more sophisticated error handling and detection
  475.                  function calls available than 2.x.
  476.  
  477.         DOS 3.0  supports function calls 00h to 5Ch and 62h, including
  478.                  new and changed function calls for version 3.0:
  479.                    3Dh  Open File
  480.                    59h  Get Extended Error
  481.                    5Ah  Create Temporary File
  482.                    5Bh  Create New File
  483.                    5Ch  Lock/Unlock File Access
  484.                    62h  Get Program Segment Prefix Address
  485.  
  486.         DOS 3.1  supports function calls 00h to 62h, including the
  487.                  new  and changed function calls for DOS 3.1:
  488.                    5E00h  Get Machine Name
  489.                    5E02h  Set Printer Setup
  490.                    5E03h  Get Printer Setup
  491.                    5F02h  Get Redirection List Entry
  492.                    5F03h  Redirect Device
  493.                    5F04h  Cancel Redirection
  494.  
  495.         DOS 3.2  supports the following new functions:
  496.                    44h    extended IOCTL functions
  497.  
  498.         DOS 3.3  supports the following new functions:
  499.                    44h    extended IOCTL functions
  500.                    65h    get extended country information (DOS 3.3)
  501.                    66h    get/set global code page table (DOS 3.3)
  502.                    67h    set handle count (DOS 3.3)
  503.                    68h    commit file (DOS 3.3)
  504.  
  505.         DOS 4.0  supports the following new functions:
  506.                    44h    extended IOCTL functions
  507.                    69h    disk serial number
  508.                    6Ch    extended open/create
  509.  
  510.         DOS 5.0  supports the following new int 21h functions:
  511.                    30h     sub 00h Get OEM ID number
  512.                            sub 01h Get version flag
  513.                    33h     sub 06h Return "real" DOS version number
  514.                    44h     sub 0Dh/68h, Sense Media Type
  515.                            sub 10h Query IOCTL handle
  516.                            sub 11h Query IOCTL device
  517.                    4Bh     sub 01h load but don't execute
  518.                                    (formerly undocumented)
  519.                            sub 05h  Enter EXEC State
  520.                    51h     Get Program Segment Prefix
  521.                                    (formerly undocumented)
  522.                    58h     sub 02h Get UMB Link Status
  523.                            sub 03h Set UMB Link Status
  524.                    65h     Get Extended Country Information
  525.                            sub 05h  Get filename character table
  526.                            sub 20h  Convert character
  527.                            sub 21h  Convert string
  528.                            sub 22h  Convert ASCIIZ string
  529.  
  530.                 ...and the following other functions:
  531.                    2Fh     sub 1680h MS-DOS Idle Call
  532.                    Task Switcher API
  533.  
  534.         DOS 6.0  supports the following new int 21h functions:
  535.                    44h     sub 04h adds DoubleSpace flush
  536.  
  537.  
  538. PCjr Cartridge Support .......................................... 4**9
  539.  
  540. ==========================
  541. ibm.dos/secrets.2 #1337, from jswitzer, 525 chars, Sat Jul 29 08:48:15 1989
  542. This is a comment to message 1334.
  543. --------------------------
  544. The PCJr ROM cartridges have a command table that lists the name of
  545. each supported command and its vector in the ROM.  It does the ROM
  546. match first before the internal command match, actually, so it will
  547. execute what it finds there.  Now that I think about it, this means that
  548. you could burn your own ROMs in the proper format and get your own
  549. commands. Neat, I guess.
  550.  
  551. As to it being in command.com, my DOS 3.3 version has some of the code
  552. about 1A4C.  Do a search with debug for "55 AA" and you'll find the
  553. main routine.
  554.  
  555. Read:comment
  556. Comment to message number 1337. Enter text. End with '.<CR>'
  557. > 55 AA, that's right. That's the ID for a valid ROM. I'll fire up
  558. > symdeb and poke through COMMAND if I can find my little white cane...
  559.  
  560.  
  561. ==========================
  562. ibm.dos/secrets.2 #1776, from jswitzer, 319 chars, Tue Sep 19 01:33:09 1989
  563. This is a comment to message 1773.
  564. --------------------------
  565. Actually, you can NOP all of the PCJr code without problems -- AST and
  566. Toshiba both have COMMAND.COM without it, and no major problems.  The
  567. interesting thing is that PC-DOS 4.0x still has it, and they explicity
  568. say that DOS 4 is NOT supported on the PCJr (*they* meaning IBM, of
  569. course).
  570.  
  571. What can you figure, huh?
  572.  
  573. Read:comment
  574. Comment to message number 1776. Enter text. End with '.<CR>'
  575. > I sold my PCjr this morning (I swear to Baud!) and therefore can't make
  576. >a test to see what would happen with 4.0 on the Jr. If IBM still sells
  577. >the PC/JX in Japan that might be the reason for continuing cartridge
  578. >support, since the machine is PCjr-based (well, about the way a PS/2 is
  579. >PC-based).
  580. > I used to run Toshiba DOS 2.11V on the Jr since it was provably faster
  581. >on screen updates and disk access than IBM 2.1 (with a Jr, it doesn't take
  582. >much to make a noticable difference). The only cartridges I had were
  583. >ColorPaint and BASIC, and I can't remember if I used 2.11 with them or
  584. >not.
  585. >
  586. ==========================
  587. ibm.dos/secrets.2 #1777, from jswitzer, 251 chars, Tue Sep 19 01:34:24 1989
  588. --------------------------
  589. The PCJr code in COMMAND.COM is ONLY executed on the PCJr and the PCJr
  590. doesn't support normal BIOS expansion ROMs, only the expansion cartridges.
  591.  
  592. So, no conflict.  If you patch out the check for the PCJr machine ID,
  593. though, good luck!
  594.         John Switzer
  595. Read:comment
  596. Comment to message number 1777. Enter text. End with '.<CR>'
  597. > Ummm..... lemme go back and look at the listing again. The way it looked
  598. >the first time, it seemed like ALL commands went through the loop.
  599.  
  600.  
  601. Compatibility Problems With DOS 4.0 ............................. 4**10
  602.  
  603.   Compatibility problems with DOS 4.00 lie mainly in int 2Ah and int 
  604. 2Fh.  While 2Ah was always reserved, some network software uses this 
  605. interrupt.  IBM and Microsoft documentation prior to 4.0 strongly 
  606. implies that int 2Fh functions not already used by PRINT.COM were open 
  607. for general use.  DOS 4.00 grabs a number of these functions. The 
  608. difference in disk handling when >32mb partitions are used causes 
  609. problems with some older software. 
  610.  
  611.   Most DOS 4.00 external programs (ASSIGN, SUBST, etc) check for files 
  612. being printed - including LABEL.  This is part of the enhanced network 
  613. support.  Almost all DOS 4.00 externals make checks for NETBIOS too. 
  614.  
  615.   DOS 5.0 ditched most of this peculiar stuff, making for a much more 
  616. stable product.
  617.  
  618.  
  619.  
  620. eDOS 4.0 ........................................................ 4**11
  621.  
  622.   Microsoft had announced their intent to build a multitasking, 
  623. multiuser version of MSDOS as early as 1982.   As mentioned in Chapter 
  624. 1, the DOS 4.0 issued to selected OEMS in England and Europe in 
  625. '86/'87 is not the same code that was released here as DOS 4.0 in 
  626. 1988.  Microsoft shipped betas of "DOS 4.0" in the US during the same 
  627. time period, but the product was never release in the US.  The 
  628. European DOS 4.0 (eDOS?) is a multitasking DOS written by Microsoft, 
  629. while the US DOS 4.0 is a single tasking DOS written by IBM.  eDOS 4.0 
  630. was released in Europe after 3.1, but before 3.2. 
  631.  
  632. (abstracted from a pre-release document):
  633.  
  634.   `Microsoft Multitasking MS-DOS Product Specification'  dated April
  635. 28, 1986
  636.  
  637.   MS-DOS 4.0 is a multitasking operating system, developed from and 
  638. compatible with MS-DOS 3.1.  It supports true multitasking which gives 
  639. the user the illusion of and benefits from many independent computers.  
  640. Further, MS-DOS 4.0 allows most existing MS-DOS 2.x and 3.x 
  641. applications to run without change in the MS-DOS 4.0 multitasking 
  642. environment. 
  643.  
  644. (end of abstract).
  645.  
  646.   Gordon Letwin of Microsoft had this to say about eDOS:
  647.  
  648. (excerpted from "Turning Off The Car To Change Gears" Microsoft Systems
  649.  Journal, volume 2, number 2. May 1987)
  650.  
  651.   "DOS 4 was the first product to result from Microsoft's multitasking 
  652. DOS effort.  We began it even before IBM introduced the PC AT.  It was 
  653. an ambitious project that was originally to include a protected mode 
  654. with mode switching capabilities so it could run on the 8086 or the 
  655. 286. 
  656.   A general-purpose multitasking system needs to run in both modes: 
  657. the unprotected 8086 mode so that we can run existing DOS 
  658. applications, and the protected 286 mode so that we can multitask 
  659. arbitrary, unrelated applications. But the architecture of the 286 
  660. caused some delays.  Although we knew the project would be difficult, 
  661. it was only after we'd gotten deeply into it that we realized just how 
  662. difficult it would be. 
  663.   As a result, DOS 4 became too complicated for our schedules.  
  664. Because of the pressure of customer demand as well as that of previous 
  665. commitments, we broke the project into two parts.  DOS 4 runs only in 
  666. real mode and provides multitasking only for specialized applications.  
  667. DOS 5, which has now been released as OS/2, includes the protected 
  668. mode and other features.  DOS 4 was delivered in the last half of 1986 
  669. and is being sold in special application environments, primarily in 
  670. Europe.  It is a specialized product that can share the market with 
  671. OS/2, because it runs on 8086 hardware, while OS/2 requires a 286.  
  672. The move from DOS 4 to OS/2 was a gradual evolutionary process." 
  673.  
  674. (end of excerpt)
  675.  
  676.   eDOS 4.0 consisted of one main program (DOS2/3 compatible) and 
  677. several multitasking (background) programs that had to be written 
  678. specially.  The whole lot was constrained to fit in the single 640k 
  679. memory map. 
  680.  
  681. int 21h functions:   (some of these appeared in later versions of DOS)
  682.  
  683. AEXEC       Identical to EXEC sub 4.
  684. CREATMEM    creates a named area of memory which may be accessed by
  685.             other processes.  (shared memory \SHAREMEM\...)
  686. CRITENTER, CRITLEAVE (semaphore routines)
  687. CRITERR     (This is the one that should have been in DOS 3)
  688.             Enables hard error processing or automatically fails hard
  689.             errors.
  690. CWAIT       Waits for return code from asynchronous process.  Returns
  691.             when any child process terminates.  Children may also be
  692.             started as orphans in which case you cannot WAIT for them.
  693. EXEC 4Bh    (sub function 4) - Start async process.
  694. FREEZE      Stops a specified process running.
  695. GETEXTENDEDERROR - As for DOS3 except it checks version number to
  696.             specify the level of error handling - you may ask for a
  697.             pointer to the hard error information packet for the latest
  698.             hard error.
  699. GETMEM      obtains access to a shared memory area previously created.
  700. GETPID      Returns process ID and parents process ID.
  701. GET/SET MEMORY PARTITION SIZE
  702.             foreground memory is used for ordinary apps.  Background
  703.             memory is used for DOS 4 apps that don't use the screen (or
  704.             only use it through popup functions).  Background apps can
  705.             also use foreground memory but not vice versa.
  706. KILL        Terminates a process.
  707. PBLOCK      Block a process until matching PRUN is given.  A timeout
  708.             is also specified.  A memory location is passed which must
  709.             be matched in the PRUN.  (semaphore)
  710. PIPE        Create a pipe.  Access it through READ/WRITE/CLOSE (but not
  711.             LSEEK).
  712. PRUN        Release a blocked process.  (semaphore)
  713. RELEASEMEM  Release access to shared memory.  If the reference count
  714.             hits zero then the memory is freed.
  715. RESUME      Thaws a frozen process.
  716. SEND SIGNAL
  717.             Signals were:
  718.                   SIGINTR, SIGTERM, SIGPIPE, SIGUSER1, SIGUSER2.
  719.                   Control C, End of program, Broken pipe, user def,
  720.                   user def.
  721.             Actions were:
  722.                   Terminate process on receipt, ignore, accept,
  723.                   sender gets error or acknowledge received signal.
  724.            The last one of these returns to the sender immediately -
  725.            it is intended for use when processing the signal will take
  726.            a long time.
  727. SETFILETABLE (86h)   Install a new file handle table. (more than 20
  728.            files, as in DOS 3.3+?)
  729. SETPRI      Sets process priority (for this process or entire subtree).
  730. SET SIGNAL HANDLER
  731. SLEEP       Suspends the current process for given number of
  732.             milliseconds.  MSC 4.0 had a demo which called 'DOS_sleep'
  733.             int 21h/fn 89h - does not appear to be implemented in
  734.             known DOS versions.
  735. WAIT        As for DOS 3.
  736.  
  737. int 2Fh functions:
  738.  
  739. CHECKPU    check for popup package installation
  740. POSTPU     open/close a popup screen
  741. SAVEPU     save popup screen
  742. RESTOREPU  restore popup screen
  743.  
  744. Other useful features:
  745.  
  746.    eDOS 4.0 programs used the Windows .EXE format
  747.    programs may share code segments
  748.    improved device drivers
  749.        the serial port had a full set of IOCTL calls (used through
  750.           a new generic IOCTL call).
  751.        device drivers could be multi-tasking.  They had appropriate
  752.           support routines to queue multiple requests (just like OS/2
  753.           later provided)
  754.    interrupt driven serial ports
  755.    sorted disk buffers before writing
  756.  
  757.  
  758. The following were listed as possible future enhancements:
  759.  
  760.    File system protection and        (not yet available from MS,
  761.      permissions                      though DRI has it)
  762.  
  763.    High performance file system      (HPFS was delivered in OS/2 1.2)
  764.  
  765.    Installable file systems          (IFS hook is present in US DOS 
  766.                                       4.0, deleted in DOS 5 according
  767.                                       to Gordon Letwin of Microsoft)
  768.  
  769.    Symbolic links                    (they don't have these on OS/2
  770.                                       even now do they?)
  771.  
  772.    Undelete                          (added with DOS 5.0)
  773.  
  774.    Long names, lowercase names,      (OS/2 HPFS, NT NTFS)
  775.    access/creation date/time, name
  776.    of app creating file, revision
  777.    number etc.
  778.  
  779.  
  780.   According to bits of information picked up from BIX, Wang tested an 
  781. alpha version of eDOS 4.0 for use on a laptop project sometime in 1985 
  782. but gave up because the OS was unable to cope with "ill behaved" 
  783. programs in a reasonable fashion.  I talked with one person who had 
  784. beta-tested it for MS, who commented "the only thing it would run was 
  785. COMMAND.COM."  Microsoft has evidently either squashed eDOS completely 
  786. or (likely) incorporated it into OS/2.  I've been unable to determine 
  787. if the French post office still uses eDOS, and to the best I can find 
  788. out Apricot Computer never did much with it. 
  789.  
  790.   DOSREF user John Dallman contributed the following:  (July 1992)
  791.  
  792.   "You put a few notes in DOSREF about the multi-tasking MS-DOS 4.0 
  793. that was released in Europe during 1986/87.  Notably, you wondered if 
  794. it ever reached any customers.  I'm sorry to tell you that the answer 
  795. is yes - briefly.  It was withdrawn owing to serious reliability 
  796. problems: Apricot and ICL sold it in the UK, and I've had email from 
  797. someone who bought a retail copy in Hong Kong." 
  798.  
  799.   Ray Duncan had this to say about eDOS' metamorphosis: (PC Magazine, 
  800. October 16, 1990 excerpted from Power Programming, page 464) 
  801.  
  802.   "OS/2 as it exists today is a vastly different system than the 
  803. protected-mode successor to DOS first envisioned by Microsoft in 1984 
  804. and 1985.  The earliest version, internally known as DOS 5.0 or 
  805. 286DOS, was small and relatively fast - it could even be booted from a 
  806. floppy disk on a 1mb 80286 machine.  The 286DOS application program 
  807. interface (API), which was a proper superset of the DOS Int 21h, 
  808. Microsoft Mouse Int 33h, and ROM BIOS video Int 10h and keyboard Int 
  809. 16h interfaces, was small enough to be easily understood and allowed 
  810. the straightforward porting of any DOS application.  286DOS was not 
  811. burdened with a built-in graphical user interface; the original plan 
  812. was to make a protected-mode version of Microsoft Windows available as 
  813. a separate product that the user could run on top of 286DOS as an 
  814. option. 
  815.  But somewhere along the torturous path from the original, 
  816. experimental implementations of 286DOS to the retail product now known 
  817. as OS/2, things went badly awry..." 
  818.  
  819.   Microsoft Press' "MSDOS Encyclopedia" shows a reproduction of a late 
  820. DOS 1.25 OEM brochure.  Microsoft was touting future enhancements to 
  821. 1.25 including Xenix-compatible pipes, process forks, and 
  822. multitasking, as well as "graphics and cursor positioning, kanji 
  823. support, multi-user and hard disk support, and networking."  Microsoft 
  824. certainly thought big, but, alas, the forks, multitasking, and 
  825. multiuser support never came about, at least in US versions of DOS.  
  826. Oddly, the flyer claims that... 
  827.  
  828.  "MS-DOS has no practical limit on disk size.  MS-DOS uses 4-byte 
  829. XENIX OS compatible pointers for file and disk capacity up to 4 
  830. gigabytes." 
  831.  
  832.   Umm... yeah.  One sort of gets the idea nobody at Microsoft had a 
  833. hard disk larger than 32 megabytes... 
  834.  
  835.  For the record they actually delivered:
  836.                                 
  837. Xenix-compatible pipes             DOS 2.0  ("|" operator)
  838. process forks, and multitasking   eDOS 4.0  (not delivered in the US)
  839. multi-user                         never delivered
  840. graphics and cursor positioning    DOS 2.0  (ANSI.SYS, more than likely)
  841. kanji support                      DOS 2.01, 2.25 (double-byte char set)
  842. hard disk support                  DOS 2.0  (subdirectories)
  843. networking                         DOS 3.1  (file locking, MS Networks)
  844.  
  845.   Early Microsoft ads pumped DOS' Xenix-like features and promised 
  846. Xenix functionality in future releases. 
  847.  
  848.   We'll probably never know what the real story was behind eDOS - DOS 
  849. 4 - DOS 5 - 286DOS - OS/2.  Despite Gordon Letwin's acid comments 
  850. about problems with the 80286 processor, I doubt the '286 was the 
  851. barrier between users and a multitasking MSDOS.  I also doubt there 
  852. was any shortage of programming talent at Microsoft - Digital 
  853. Research's Concurrent DOS and Software Link's PC-MOS were developed 
  854. without undue trouble. 
  855.  
  856.   Though it's highly unlikely anyone would ever need programming 
  857. information for eDOS, I find the entire subject fascinating.  IBM had 
  858. not only promised the product, they ran ads for it in 1984-85. Who 
  859. axed the project?  Why?  We'll likely never find out. 
  860.  
  861.  
  862.  
  863. DOS Services in Detail .......................................... 4**12
  864.  
  865.  
  866. INT 21H   DOS services
  867.           Function (hex)
  868.  
  869. * Indicates Functions not documented in the IBM DOS Technical
  870. Reference.
  871.  
  872.   Note some functions have been documented in other Microsoft or
  873. licensed OEM documentation.
  874.  
  875.  
  876. Function  00h   Terminate Program
  877.       Ends program, updates, FAT, flushes buffers, restores registers
  878. entry   AH      00h
  879.         CS      segment address of PSP
  880. return  none
  881. note 1) Program must place the segment address of the PSP control
  882.         block in CS before calling this function.
  883.      2) The terminate, ctrl-break,and critical error exit addresses
  884.         (0Ah, 0Eh, 12h) are restored to the values they had on entry
  885.         to the terminating program, from the values saved in the
  886.         program segment prefix at locations PSP:000Ah, PSP:000Eh, and
  887.         PSP:0012h.
  888.      3) All file buffers are flushed and the handles opened by the
  889.         process are closed.
  890.      4) Any files that have changed in length and are not closed are
  891.         not recorded properly in the directory.
  892.      5) Control transfers to the terminate address.
  893.      6) This call performs exactly the same function as int 20h.
  894.      7) All memory used by the program is returned to DOS.  DOS just
  895.         goes up the chain of memory blocks and marks any that are
  896.         owned by the PSP which is terminating as free.
  897.      8) TOS: $00 TERM.  Returns system control to the program from
  898.         which it started.  If EXECed from a program, returns to that
  899.         program.  If started from DeskTop, returns to DeskTop.  This
  900.         is important for chaining program segments.
  901.      9) Files opened with FCBs are not automatically closed.
  902.     10) Supported in PC-MOS/386 compatibility mode, but not available
  903.         for native MOS 386-mode applications.
  904.  
  905.  
  906. Function  01h     Get Keyboard Input
  907.         Waits for char at STDIN (if necessary), echoes to STDOUT
  908. entry   AH      01h
  909. return  AL      ASCII character from STDIN (8 bits)
  910. note 1) Checks char for Ctrl-C, if char is Ctrl-C, executes int 23h.
  911.      2) For function call 06h, extended ASCII codes require two
  912.         function calls.  The first call returns 00h as an indicator
  913.         that the next call will be an extended ASCII code.
  914.      3) Input and output are redirectable.  If redirected, there is
  915.         no way to detect EOF.
  916.      4) TOS: $1 CONIN.  Char returns in D0. ASCII code of char in
  917.         high byte, keyboard scan code in low byte.  Will return
  918.         scancode on keys which have no ASCII value.
  919.  
  920.  
  921. Function  02h   Display Output
  922.       Outputs char in DL to STDOUT
  923. entry   AH      02h
  924.         DL      8 bit data (usually ASCII character)
  925. return  none
  926. note 1) If char is 08 (backspace) the cursor is moved 1 char to the
  927.         left (nondestructive backspace).
  928.      2) If Ctrl-C is detected after input, int 23h is executed.
  929.      3) Input and output are redirectable.  If redirected, there is no
  930.         way to detect disk full.
  931.      4) TOS: $2 CONOUT.  Char must be placed on the stack as the first
  932.         word.  The ASCII value of the char goes in the low byte and
  933.         the high byte is zero.  Chars are output to DEVICE #2, normal
  934.         console output.  Control characters and escape sequences are
  935.         interpreted normally.
  936.      5) Under DOS 1.x, 02h sends a character to the active display.
  937.         Under DOS 2.x and later, the char goes to STDOUT.
  938.  
  939.  
  940. Function  03h   Auxiliary Input
  941.       Get (or wait until) character from STDAUX
  942. entry   AH      03h
  943. return  AL      ASCII char from auxiliary device
  944. note 1) AUX, COM1, COM2 is unbuffered and not interrupt driven.
  945.      2) This function call does not return status or error codes.
  946.         For greater control it is recommended that you use the ROM BIOS
  947.         routines (int 14h) or write an AUX device driver and use IOCTL.
  948.      3) At startup, PC-DOS initializes the first auxiliary port (COM1)
  949.         to 2400 baud, no parity, one stop bit, and an 8-bit word.
  950.         Versions of MSDOS may differ.
  951.      4) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  952.      5) TOS: $03 AUXILIARY INPUT.  Function returns when the character
  953.         has been received.  Char is returned in the low byte of D0.
  954.      6) Under DOS 1.x, the character is read from COM1.  Under DOS
  955.         2.x and later, it is read from STDAUX.
  956.  
  957.  
  958. Function  04h   Auxiliary Output
  959.       Write character to STDAUX
  960. entry   AH      04h
  961.         DL      ASCII char to send to AUX
  962. return  none
  963. note 1) This function call does not return status or error codes.
  964.         For greater control it is recommended that you use the ROM
  965.         BIOS routine (int 14h) or write an AUX device driver and use
  966.         IOCTL.
  967.      2) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  968.      3) Default is COM1 unless redirected by DOS.
  969.      4) If the device is busy, this function will wait until it is
  970.         ready.
  971.      5) TOS: $04 AUXILIARY OUTPUT.  High byte should be zero, low byte
  972.         is ASCII code.
  973.      6) Under DOS 1.x, the character is sent to COM1.  Under DOS 2.x
  974.         and later, it goes to STDAUX.
  975.  
  976.  
  977. Function  05h   Printer Output
  978.       Write character to STDPRN
  979. entry   AL      05h
  980.         DL      ASCII code for character to send
  981. return  none
  982. note 1) If Ctrl-C is has been entered from STDIN, int 23h is executed.
  983.      2) Default is PRN or LPT1 unless redirected with the MODE command.
  984.      3) If the printer is busy, this function will wait until it is
  985.         ready.
  986.      5) TOS: $05 PRINTER OUTPUT.  High byte of D0 is zero, low byte is
  987.         character.  Returns -1 if character is sent successfully.
  988.         Times out after 30 seconds and resets D0 to zero.
  989.      6) Under DOS 1.x, this function writes to LPT1.  Under DOS 2.x
  990.         and higher it writes to STDPRN.
  991.  
  992.  
  993. Function  06h   Direct Console I/O
  994.       Get character from STDIN; echo character to STDOUT
  995. entry   AH      06h
  996.         DL      0FFh for console input, or 00h-0FEh for console output
  997. return  ZF      set     no character available
  998.                 clear   character recieved
  999.         AL      ASCII code for character
  1000. note 1) Extended ASCII codes require two function calls.  The first
  1001.         call returns 00h to indicate the next call will return an
  1002.         extended code.
  1003.      2) If DL is not 0FFh, DL is assumed to have a valid character
  1004.         that is output to STDOUT.
  1005.      3) This function does not check for Ctrl-C or Ctrl-PrtSc.
  1006.      4) Does not echo input to screen.
  1007.      5) If I/O is redirected, EOF or disk full cannot be detected.
  1008.      6) TOS: $06 RAWCONIO.  Get character from keyboard by calling
  1009.         with $FF in D0.  ASCII and scan codes are returned as per
  1010.         CONIN.  If a value other than $FF is used, it is printed to
  1011.         STDOUT at the current cursor position.  This call interprets
  1012.         all control chars and escape sequences.
  1013.      7) Under DOS 1.x, this call handles the keyboard and display
  1014.         directly.  Under DOS 2.x and later, calls are routed to the
  1015.         STDOUT driver.
  1016.  
  1017.  
  1018. Function  07h   Direct Console Input Without Echo
  1019.       Get or wait for char at STDIN, returns char in AL
  1020.       (does not check BREAK)
  1021. entry   AH      07h
  1022. return  AL      ASCII character from standard input device
  1023. note 1) Extended ASCII codes require two function calls.  The first
  1024.         call returns 00h to indicate the next call will return an
  1025.         extended code.
  1026.      2) No checking for Ctrl-C or Ctrl-PrtSc is done.
  1027.      3) Input is redirectable.
  1028.      4) TOS: $07 DIRECT CONIN WITHOUT ECHO.  Same as function 01h
  1029.         only does not echo character to screen.
  1030.      5) Under DOS 1.x the keyboard is read directly.  Under DOS 2.x
  1031.         and later the STDIN is polled.
  1032.  
  1033.  
  1034. Function  08h   Console Input Without Echo
  1035.        Get or Wait for char at STDIN, return char in AL
  1036.        (checks BREAK)
  1037. entry   AH      08h
  1038. return  AL      char from standard input device
  1039. note 1) Char is checked for ctrl-C. If ctrl-C is detected, executes
  1040.         int 23h.
  1041.      2) For function call 08h, extended ASCII characters require two
  1042.         function calls.  The first call returns 00h to signify an
  1043.         extended ASCII code.  The next call returns the actual code.
  1044.      3) Input is redirectable.  If redirected, there is no way to
  1045.         check EOF.
  1046.      4) TOS: $08 CONIN WITHOUT ECHO.  Same as previous call. (no
  1047.         checking for control characters).
  1048.      5) Under DOS 1.x the keyboard is read directly.  Under DOS 2.x
  1049.         and later the STDIN is polled.
  1050.  
  1051.  
  1052. Function  09h   Print String
  1053.       Outputs Characters in the Print String to the STDOUT
  1054. entry   AH      09h
  1055.         DS:DX   pointer to the Character String to be displayed
  1056. return  none
  1057. note 1) The character string in memory must be terminated by a $
  1058.         character. (ASCII 24h)
  1059.      2) The $ is not displayed but remains in AL forever unless popped.
  1060.      3) Output to STDOUT is the same as function call 02h.
  1061.      4) TOS: $09 PRINT LINE.  The address of the ASCIIZ string is
  1062.         placed on the stack as a parameter and is printed at the
  1063.         current cursor position.  There is no limit to the size of the
  1064.         string.  D0 contains the number of characters to be printed.
  1065.         Control and escape codes are evaluated.
  1066.      5) Under DOS 1.x, this function writes to the screen.  Under DOS
  1067.         2.x and higher it writes to STDOUT.
  1068.  
  1069.  
  1070. Function  0Ah   Buffered Keyboard Input
  1071.       Reads characters from STDIN and places them in the buffer
  1072.       beginning at the third byte.
  1073. entry   AH      0Ah
  1074.         DS:DX   pointer to an input buffer
  1075. return  none
  1076. note 1) Min buffer size = 1, max = 255.
  1077.      2) Char is checked for ctrl-C. If ctrl-C is detected, executes
  1078.         int 23h.
  1079.      3) Format of buffer DX:
  1080.         byte       contents
  1081.          1      Maximum number of chars the buffer will take,
  1082.                 including CR.  Reading STDIN and filling the buffer
  1083.                 continues until a carriage return (<Enter> or 0Dh) is
  1084.                 read.  If the buffer fills to one less than the maximum
  1085.                 number the buffer can hold, each additional number read
  1086.                 is ignored and ASCII 7 (BEL) is output to the display
  1087.                 until a carriage return is read. (you must set this
  1088.                 value)
  1089.          2      Actual number of characters received, excluding the
  1090.                 carriage return, which is always the last character.
  1091.                 (the function sets this value)
  1092.          3-n    Characters received are placed into the buffer
  1093.                 starting here.  Buffer must be at least as long as the 
  1094.                 number in byte 1.
  1095.          n+1    Carriage return character (0Dh).
  1096.      4) Input is redirectable.  If redirected, there is no way to
  1097.         check EOF.
  1098.      5) The string may be edited with the standard DOS editing
  1099.         commands as it is being entered.
  1100.      6) Extended ASCII characters are stored as 2 bytes, the first
  1101.         byte being zero.
  1102.      7) TOS: $0A READLINE.  Fetches CR-terminated line from CONIN.
  1103.         The address of the buffer is passed as a parameter.  Byte 1
  1104.         is the maximum length of the line, byte 2 is the number of
  1105.         characters entered, byte 3 is the first character.  Escape
  1106.         codes are not interpreted, but the normal editing control
  1107.         characters are.
  1108.      8) Under DOS 1.x the keyboard is read directly.  Under DOS 2.x
  1109.         and later the STDIN is polled.
  1110.  
  1111.  
  1112. Function  0Bh   Check Standard Input (STDIN) status
  1113.       Checks for character available at STDIN
  1114. entry   AH      0Bh
  1115. return  AL      00h     if no character is available from STDIN
  1116.                 0FFh    if a character is available from STDIN
  1117. note 1) Checks for Ctrl-C. If Ctrl-C is detected, int 23h is executed.
  1118.      2) Input can be redirected.
  1119.      3) Checks for character only, it is not read into the application.
  1120.      4) IBM reports that this call does not work properly under the
  1121.         DOSSHELL program in DOS 4.00 and 4.01.  DOSSHELL will return
  1122.         all zeroes.  This function works correctly from the command
  1123.         line or application.
  1124.      5) TOS: $0B CONSTAT.  Checks 64-byte OS input buffer.
  1125.      6) Under DOS 1.x, the type-ahead buffer is checked.  Under DOS
  1126.         2.x and later, the type-ahead buffer is checked unless STDIN
  1127.         has been redirected.
  1128.  
  1129.  
  1130. Function  0Ch   Clear Keyboard Buffer & Invoke a Keyboard Function
  1131.       Dumps buffer, executes function in AL                  (FCB)
  1132. entry   AH      0Ch
  1133.         AL      function number (must be 01h, 06h, 07h, 08h, or 0Ah)
  1134.                 note: the DOS 5.0 TR specifies 0Ah as reserved and
  1135.                        "must not be used"
  1136. return  AL      00h     buffer was flushed, no other processing
  1137.                         performed
  1138.                 other   any other value has no meaning
  1139. note 1) Forces system to wait until a character is typed.
  1140.      2) Flushes all typeahead input, then executes function specified
  1141.         by AL (by moving it to AH and repeating the int 21 call).
  1142.      3) If AL contains a value not in the list above, (such as 00h)
  1143.         the input buffer is flushed and no other action is taken.  Note
  1144.         that this is the STDIN buffer, not the actual keyboard buffer.
  1145.         The keyboard buffer will not be flushed if input is redirected.
  1146.      4) Under DOS 1.x, the type-ahead buffer is emptied before the
  1147.         function in AL is performed.
  1148.  
  1149.  
  1150. Function  0Dh   Disk Reset
  1151.       Flushes all currently open file buffers to disk
  1152. entry   AH      0Dh
  1153. return          none
  1154. note 1) Does not close files.  Does not update directory entries;
  1155.         files changed in size but not closed are not properly
  1156.         recorded in the directory.
  1157.      2) Sets DTA address to DS:0080h
  1158.      3) Should be used before a disk change, Ctrl-C handlers, and to
  1159.         flush the buffers to disk.
  1160.      4) This call is explicitly supported in the OS/2 1.x DOS
  1161.         Compatibility Box.
  1162.      5) IBM TopView saves DTA information during task switches.
  1163.  
  1164.  
  1165. Function  0Eh   Select Disk
  1166.       Sets the drive specified in DL (if valid) as the default drive
  1167. entry   AL      0Eh
  1168.         DL      new default drive number (0=A:,1=B:,2=C:,etc.)
  1169. return  AL      number of physical drives found unless LASTDRIVE= is
  1170.                 included in CONFIG.SYS and specifies a higher number
  1171.                 than that of the last physical drive.
  1172. note 1) For DOS 1.x and 2.x, the minimum value for AL is 2.
  1173.      2) For DOS 3.x and 4.x, the minimum value for AL is 5.
  1174.      3) The drive number returned is not necessarily a valid drive.
  1175.      4) For DOS 1.x: 16 logical drives are available, A-P. (0-0Fh) 
  1176.         For DOS 2.x: 63 logical drives are available. (Letters are only
  1177.                      used for the first 26 drives.  If more than 26
  1178.                      logical drives are used, further drive letters
  1179.                      will be other ASCII characters, such as {, ],
  1180.                      etc. (0-3Fh)
  1181.         For DOS 3.x, +: 26 logical drives are available, A-Z. (0-19h)
  1182.      5) TOS: $0E SETDRV.  A 16-bit parameter with drivespec is passed
  1183.         to TOS.  On exit, D0 contains the number of the drive active
  1184.         before the call. (not the total number of drives)
  1185.      6) This call is explicitly supported in the OS/2 1.x DOS
  1186.         Compatibility Box.
  1187.      7) For DOS 3.3, LASTDRIVE= is not needed when accessing
  1188.         additional hard disk partitions past E:.  I haven't done any
  1189.         further checking, but it seems that LASTDRIVE= may be fairly
  1190.         useless to most programs.
  1191.      6) IBM TopView saves DTA information during task switches.
  1192.  
  1193.  
  1194. Function  0Fh   Open Disk File                                  (FCB)
  1195.       Searches current directory for specified filename and places
  1196.       relevantinformation into the File Control Block.
  1197. entry   AH      0Fh
  1198.         DS:DX   pointer to an unopened FCB
  1199. return  AL      00h     if file found
  1200.                 0FFh    if file not not found
  1201. note 1) If the drive code was 0 (default drive) it is changed to the
  1202.         actual drive used (1=A:,2=B:,3=C:, etc).  This allows changing
  1203.         the default drive without interfering with subsequent
  1204.         operations on this file.
  1205.      2) The current block field (FCB bytes C-D, offset 0Ch) is set to
  1206.         zero.
  1207.      3) The size of the record to be worked with (FCB bytes E-F, offset
  1208.         0Eh) is set to the system default of 80h.  The size of the file
  1209.         (offset 10h) and the date (offset 14h) are set from information
  1210.         obtained in the root directory.  You can change the default
  1211.         value for the record size (FCB bytes E-F) or set the random
  1212.         record size and/or current record field.  Perform these actions
  1213.         after the open but before any disk operations.
  1214.      4) With DOS 3.x the file is opened in compatibility mode.
  1215.         (network)
  1216.      5) Microsoft recommends handle function call 3Dh be used instead.
  1217.      6) This call is also used by the APPEND command in DOS 3.2 and 
  1218.         higher.
  1219.      7) Before performing a sequential disk operation on the file, you
  1220.         must set the Current Record field (offset 20h).  Before
  1221.         performing a random disk operation on the file, you must set
  1222.         the Relative Record field (offset 21h).  If the default record
  1223.         size of 128 bytes is incorrect, set it to the correct value.
  1224.  
  1225.  
  1226. Function  10h  Close File                                     (FCB)
  1227.      Closes a File After a File Write
  1228. entry   AH      10h
  1229.         DS:DX   pointer to an opened FCB
  1230. return  AL      00h     if the file is found and closed
  1231.                 0FFh    if the file is not found in the current
  1232.                         directory
  1233. note 1) This function call must be done on open files that are no
  1234.         longer needed, and after file writes to insure all directory
  1235.         information is updated.
  1236.      2) If the file is not found in its correct position in the current
  1237.         directory, it is assumed that the diskette was changed and AL
  1238.         returns 0FFh.  This error return is reportedly not completely
  1239.         reliable with DOS version 2.x.
  1240.      3) If found, the directory is updated to reflect the status in the
  1241.         FCB, the buffers to that file are flushed, and AL returns 00h.
  1242.      4) There is a subtle but dangerous quirk to this function.  If a
  1243.         Close request is issued using a File Control Block that has
  1244.         not been previously activated by a successful Open command, the
  1245.         file's length will be truncated to zero and the clusters
  1246.         previously assigned to the file are left floating. (lost 
  1247.         clusters)
  1248.      5) This function works for files in the current directory only.
  1249.      6) For DOS 3.1 and later, files opened with this call are set to
  1250.         compatibility mode and the access code is set to read/write.
  1251.      7) For DOS 3.0 and later, int 21h fn 59h (Get Extended Error
  1252.         Information) may be used to determine errors.
  1253.  
  1254.  
  1255. Function  11h   Search For First Matching Entry                  (FCB)
  1256.       Searches current disk & directory for first matching filename
  1257. entry   AH      11h
  1258.         DS:DX   pointer to address of FCB
  1259. return  AL      00h     successful match
  1260.                 0FFh    no matching filename found
  1261. note 1) The FCB may contain the wildcard character ? under DOS 2.x,
  1262.         and ? or * under 3.x and later.
  1263.      2) The original FCB at DS:DX contains information to continue the
  1264.         search with function 12h, and should not be modified.
  1265.      3) If a matching filename is found, AL returns 00h and the
  1266.         locations at the Disk Transfer Address are set as follows:
  1267.         a) If the FCB provided for searching was an extended FCB, then
  1268.            the first byte at the disk transfer address is set to 0FFh
  1269.            followed by 5 bytes of zeroes, then the attribute byte from
  1270.            the search FCB, then the drive number used (1=A, 2=B, etc)
  1271.            then the 32 bytes of the directory entry.  Thus, the disk
  1272.            transfer address contains a valid unopened FCB with the same
  1273.            search attributes as the search FCB.
  1274.         b) If the FCB provided for searching was a standard FCB, then
  1275.            the first byte is set to the drive number used (1=A, 2=b,
  1276.            etc), and the next 32 bytes contain the matching directory
  1277.            entry.  Thus, the disk transfer address contains a valid
  1278.            unopened normal FCB.
  1279.      4) If an extended FCB is used, the following search pattern is
  1280.         used:
  1281.         a) If the FCB attribute byte is zero, only normal file entries
  1282.            are found.  Entries for volume label, subdirectories, hidden
  1283.            or system files, are not returned.
  1284.         b) If the attribute byte is set for hidden or system files, or
  1285.            subdirectory entries, it is to be considered as an inclusive
  1286.            search.  All normal file entries plus all entries matching
  1287.            the specified attributes are returned.  To look at all
  1288.            directory entries except the volume label, the attribute byte
  1289.            may be set to hidden + system + directory (all 3 bits on).
  1290.         c) If the attribute field is set for the volume label, it is
  1291.            considered an exclusive search, and ONLY the volume label
  1292.            entry is returned.
  1293.      5) This call is also used by the APPEND command in DOS 3.2+
  1294.  
  1295.  
  1296. Function  12h   Search For Next Entry Using FCB                 (FCB)
  1297.       Search for next matching filename
  1298. entry   AH      12h
  1299.         DS:DX   pointer to the unopened FCB specified from the previous
  1300.                 Search
  1301.                 First (11h) or Search Next (12h)
  1302. return  AL      00h     if matching filename found
  1303.                 0FFh    if matching filename was not found
  1304. note 1) After a matching filename has been found using function call
  1305.         11h, function 12h may be called to find the next match to an
  1306.         ambiguous request.  For DOS 2.x, ?'s are allowed in the
  1307.         filename.  For DOS 3.x and 4.x, global (*) filename characters
  1308.         are allowed.
  1309.      2) The DTA contains info from the previous Search First or Search
  1310.         Next.
  1311.      3) Do not perform any disk operations with this FCB between a
  1312.         previous function 11h or 12h call and this one.  "Undocumented"
  1313.         fields in the FCB are used to keep information necessary for
  1314.         continuing the search, and some disk operations may overwrite
  1315.         these areas.
  1316.      4) If the file is found, an FCB is created at the DTA address and
  1317.         set up to open or delete it.
  1318.  
  1319.  
  1320. Function  13h   Delete File Via FCB                              (FCB)
  1321.       Deletes file specified in FCB from current directory
  1322. entry   AH      13h
  1323.         DS:DX   pointer to address of FCB
  1324. return  AL      00h     file deleted
  1325.                 0FFh    if file not found or was read-only
  1326. note 1) All matching current directory entries are deleted. The global
  1327.         filename character "?" is allowed in the filename.
  1328.      2) Will not delete files with read-only attribute set.
  1329.      3) Close open files before deleting them.
  1330.      4) For DOS 3.1+, requires network Create rights to the sub-
  1331.         directory.
  1332.      5) This call supports wildcards and is very fast.  The "new"
  1333.         handle call 41h is supposed to replace this one since it knows
  1334.         about subdirectories.  Unfortunately, fn 41h doesn't know about
  1335.         wildcards.
  1336.  
  1337.  
  1338. Function  14h   Sequential Disk File Read                         (FCB)
  1339.       Reads record sequentially from disk via FCB
  1340. entry   AH  14h
  1341.         DS:DX   pointer to an opened FCB
  1342. return  AL      00h     successful read
  1343.                 01h     end of file (no data read)
  1344.                 02h     Data Transfer Area too small for record size
  1345.                         specified or segment overflow
  1346.                 03h     partial record read, EOF found
  1347. note 1) The record size is set to the value at offset 0Eh in the FCB.
  1348.      2) The record pointed to by the Current Block (offset 0Ch) and the
  1349.         Current Record (offset 20h) fields is loaded at the DTA, then
  1350.         the Current Block and Current Record fields are incremented.
  1351.      3) The record is read into memory at the current DTA address as
  1352.         specified by the most recent call to function 1Ah.  If the size
  1353.         of the record and location of the DTA are such that a segment
  1354.         overflow or wraparound would occur, the error return is set to
  1355.         AL=02h.
  1356.      4) If a partial record is read at the end of the file, it is passed
  1357.         to the requested size with zeroes and the error return is set to
  1358.         AL=03h.
  1359.      5) For DOS 3.1+ networks, requires Read rights to the subdirectory.
  1360.  
  1361.  
  1362. Function  15h   Sequential Disk Write                              (FCB)
  1363.       Writes record specified by FCB sequentially to disk
  1364. entry   AH      15h
  1365.         DS:DX   pointer to address of FCB
  1366. return  AL      00h     successful write
  1367.                 01h     diskette full, write canceled
  1368.                 02h     disk transfer area (DTA) too small or segment
  1369.                         wrap
  1370. note 1) The data to write is obtained from the disk transfer area.
  1371.      2) The record size is set to the value at offset 0Eh in the FCB.
  1372.      3) This service cannot write to files set as read-only.
  1373.      4) The record pointed to by the Current Block (offset 0Ch) and the
  1374.         Current Record (offset 20h) fields is loaded at the DTA, then
  1375.         the Current Block and Current Record fields are incremented.
  1376.      5) If the record size is less than a sector, the data in the DTA
  1377.         is written to a buffer; the buffer is written to disk when it
  1378.         contains a full sector of data, the file is closed, or a Reset
  1379.         Disk (function 0Dh) is issued.
  1380.      6) The record is written to disk at the current DTA address as
  1381.         specified by the most recent call to function 1Ah.  If the size
  1382.         of the record and location of the DTA are such that a segment
  1383.         overflow or wraparound would occur, the error return is set to
  1384.         AL=02h.
  1385.      5) For DOS 3.1+ networks, requires Write rights to the subdirectory.
  1386.  
  1387.  
  1388. Function  16h   Create A Disk File                                (FCB)
  1389.       Search and open or create directory entry for file
  1390. entry   AH      16h
  1391.         DS:DX   pointer to an FCB
  1392. return  AL      00h     successful creation
  1393.                 0FFh    no room in directory
  1394. note 1) If a matching directory entry is found, the file is truncated
  1395.         to zero bytes.
  1396.      2) If there is no matching filename, a filename is created.
  1397.      3) This function calls function 0Fh (Open File) after creating or
  1398.         truncating a file.
  1399.      4) A hidden file can be created by using an extended FCB with the
  1400.         attribute byte (offset FCB-1) set to 2.
  1401.      5) The corresponding handle call is 3Ch.
  1402.      6) For DOS 3.1+ networks, requires  Create rights to the sub-
  1403.         directory.
  1404.      7) For DOS 3.0 and later, int 21h function 59h (Get Extended Error
  1405.         Information) may be used to determine errors.
  1406.      8) Pathnames and wildcards are not supported.
  1407.  
  1408.  
  1409. Function  17h   Rename File Specified by File Control Block       (FCB)
  1410.       Renames file in current directory
  1411. entry   AH      17h
  1412.         DS:DX   pointer to an FCB (see note 4)
  1413. return  AL      00h     successfully renamed
  1414.                 0FFh    file not found or filename already exists
  1415. note 1) This service cannot rename read-only files.
  1416.      2) The "?" wildcard may be used.
  1417.      3) If the "?" wildcard is used in the second filename, the
  1418.         corresponding letters in the filename of the directory entry are
  1419.         not changed.
  1420.      4) A special modified FCB is used. It must have a drive number,
  1421.         filename, and extension in the usual position, and a second
  1422.         filename starting 6 bytes after the first, at offset 11h.  This
  1423.         is normally a "reserved" area.
  1424.         Modified FCB format:
  1425.         bytes           contents
  1426.         00h       drive number
  1427.         01h-08h   old filename (blank padded if required)
  1428.         09h-0Bh   old file extension (blank padded if reqired)
  1429.         0Ch-10h   zeroed out
  1430.         11h-18h   new filename (blank padded if required)
  1431.         19h-1Bh   new file extension (blank padded if required)
  1432.         1Ch-24h   zeroed out
  1433.      5) The two filenames cannot have the same name.
  1434.      6) FCB contains new name starting at byte 17h.
  1435.      7) Under DOS 2.0+, subdirectories may be renamed with this call.
  1436.  
  1437.  
  1438. Function  18h  Unknown - reportedly not used
  1439. entry   AH      18h
  1440. return  AL      00h
  1441.  
  1442.  
  1443. Function  19h   Get Current Disk Drive
  1444.       Return designation of current default disk drive
  1445. entry   AH      19h
  1446. return  AL      current default drive (0=A, 1=B,etc.)
  1447. note 1) Some other DOS functions use 0 for default, 1=A, 2=B, etc.
  1448.      2) This call is explicitly supported in the OS/2 1.x
  1449.         Compatibility Box.
  1450.      3) TOS: $19 CURRENT DISK. D0 returns number of drive (0=A:)
  1451.  
  1452.  
  1453. Function  1Ah   Set Disk Transfer Area Address (DTA)
  1454.       Sets DTA address to the address specified in DS:DX.
  1455.       Required for functions 4Eh and 4Fh.
  1456. entry   AH      1Ah
  1457.         DS:DX   pointer to DTA buffer
  1458. return  none
  1459. note 1) The default DTA is 128 bytes at offset 80h in the PSP.  You may
  1460.         set up your own DTA with any size and location.  The DTA should
  1461.         be large enough to handle the largest record you intend to write.
  1462.      2) Registers are unchanged.
  1463.      3) No error codes are returned.
  1464.      4) Disk transfers cannot wrap around from the end of the segment
  1465.         to the beginning or overflow into another segment.
  1466.      5) DOS uses the DTA for file I/O. (see Chapter 6)
  1467.      6) This call is explicitly supported in the OS/2 1.x
  1468.         Compatibility Box.
  1469.      7) TOS: $1A SET DISK TRANSFER ADDRESS. Sets up a 44-byte buffer for
  1470.         disk operations.
  1471.      8) PC-MOS/386: not supported for native 386 mode MOS applications.
  1472.  
  1473.  
  1474. Function  1Bh   Get Current Drive File Allocation Table Information
  1475.       Returns information from the FAT on the current drive
  1476. entry   AH      1Bh
  1477. return  AL      number of sectors per allocation unit (cluster)
  1478.         CX      number of bytes per sector
  1479.         DS:BX   address of the current drive's media descriptor byte
  1480.         DX      number of allocation units (clusters) for default drive
  1481. note 1) Save DS before calling this function.
  1482.      2) This call returned a pointer to the FAT in DOS 1.x.  Beginning
  1483.         with DOS 2.00, it returns a pointer only to the table's ID byte.
  1484.      3) IBM recommends programmers avoid this call and use int 25h
  1485.         instead.
  1486.      4) Offset DS:[BX-1] is the dirty byte for the table: 00=clean,
  1487.         01=dirty.
  1488.      5) DOS 2.x+ and above do not keep the FAT in RAM.  Do not use this
  1489.         call to access the FAT.  Function 36 is preferred.
  1490.      6) If unsuccessful, AL returns with 0FFh.
  1491.  
  1492.  
  1493. Function  1Ch   Get File Allocation Table Information for Drive
  1494.       Returns information on specified drive
  1495. entry   AH      1Ch
  1496.         DL      drive number (1=A, 2=B, 3=C, etc)
  1497. return  AL      number of sectors per allocation unit (cluster)
  1498.                 0FFh    invalid drive specification
  1499.         DS:BX   address of media descriptor byte for drive in DL
  1500.         CX      sector size in bytes
  1501.         DX      number of allocation units (clusters)
  1502. note 1) Set DL = 0 for default.
  1503.      2) Save DS before calling this function.
  1504.      3) Format of media-descriptor byte:
  1505.         bits:   0       0   (clear)   not double sided
  1506.                         1   (set)     double sided
  1507.                 1       0   (clear)   not 8 sector
  1508.                         1   (set)     8 sector
  1509.                 2       0   (clear)   nonremovable device
  1510.                         1   (set)     removable device
  1511.                 3-7     always set (1)
  1512.      4) This call returned a pointer to the FAT in DOS 1.x.  Beginning
  1513.         with DOS 2.00, it returns a pointer only to the table's ID byte.
  1514.      5) IBM recommends programmers avoid this call and use int 25h
  1515.         instead.
  1516.      6) This function reads the BPB only and is very fast.
  1517.      7) If unsuccessful, AL returns with 0FFh.
  1518.      8) PC-MOS/386: native mode should use DS:EBX instead of DS:BX.
  1519.  
  1520.  
  1521. Function  1Dh   Not Documented by Microsoft
  1522.  *    Unknown - reportedly not used
  1523. entry   AH      1Dh
  1524. return  AL      00h
  1525.  
  1526.  
  1527. Function  1Eh   Not Documented by Microsoft
  1528.  *    Unknown - reportedly not used
  1529. entry   AH      1Eh
  1530. return  AL      00h
  1531. note    Apparently does nothing.
  1532.  
  1533.  
  1534. Function  1Fh   Get Default Drive Parameter Block
  1535.     Same as function call 32h (below), except that the table is
  1536.     accessed from the default drive
  1537. entry   AH      1Fh
  1538.         other registers unknown
  1539. return  AL      00h     no error
  1540.                 0FFh    error
  1541.         DS:BX   pointer to DOS Disk Parameter Block for default drive.
  1542. note    For DOS 2, 3, 4.x, this just invokes function 32h (Read DOS
  1543.         Disk Block) with DL=0.
  1544.  
  1545.  
  1546. Function  20h  Unknown
  1547.  *   Internal - does nothing?
  1548. entry   AH      20h
  1549. return  AL      00h
  1550.  
  1551.  
  1552. Function  21h  Random Read from File Specified by File Control Block (FCB)
  1553.      Reads one record as specified in the FCB into the current DTA.
  1554. entry   AH      21h
  1555.         DS:DX   address of the opened FCB
  1556. return  AL      00h     successful read operation
  1557.                 01h     end of file (EOF), no data read
  1558.                 02h     DTA too small for the record size specified
  1559.                 03h     end of file (EOF), partial data read
  1560. note 1) The current block and current record fields are set to agree
  1561.         with the random record field.  Then the record addressed by
  1562.         these fields is read into memory at the current Disk Transfer
  1563.         Address.
  1564.      2) The current file pointers are NOT incremented this function.
  1565.      3) If the DTA is larger than the file, the file is padded to the
  1566.         requested length with zeroes.
  1567.  
  1568.  
  1569. Function  22h  Random Write to File Specified by FCB              (FCB)
  1570.      Writes one record as specified in the FCB to the current DTA
  1571. entry   AH      22h
  1572.         DS:DX   address of the opened FCB
  1573. return  AL      00h     successful write operation
  1574.                 01h     disk full; no data written (write was canceled)
  1575.                 02h     DTA too small for the record size specified
  1576.                         (write was canceled)
  1577. note 1) This service cannot write to read-only files.
  1578.      2) The record pointed to by the Current Block (offset 0Ch) and the
  1579.         Current Record (offset 20h) fields is loaded at the DTA, then
  1580.         the Current Block and Current Record fields are incremented.
  1581.      3) If the record size is less than a sector, the data in the DTA is
  1582.         written to a buffer; the buffer is written to disk when it
  1583.         contains a full sector of data, the file is closed, or a Reset
  1584.         Disk (function 0Dh) is issued.
  1585.      4) The current file pointers are NOT incremented this function.
  1586.      5) The record is written to disk at the current DTA address as
  1587.         specified by the most recent call to function 1Ah.  If the size
  1588.         of the record and location of the DTA are such that a segment
  1589.         overflow or wraparound would occur, the error return is set to
  1590.         AL=02h.
  1591.      6) Under networks running DOS 3.1 or later, the user must have
  1592.         Write access rights to the subdirectory.
  1593.  
  1594.  
  1595. Function  23h  Get File Size                                       (FCB)
  1596.      Searches current subdir for matching file, returns size in FCB
  1597. entry   AH      23h
  1598.         DS:DX   address of an unopened FCB
  1599. return  AL      00h file found
  1600.                 0FFh file not found
  1601. note 1) Record size field (offset 0Eh) must be set before invoking this
  1602.         function.
  1603.      2) The disk directory is searched for the matching entry.  If a
  1604.         matching entry is found, the random record field is set to the
  1605.         number of records in the file.  If the value of the Record Size
  1606.         field is not an even divisor of the file size, the value set in
  1607.         the relative record field is rounded up.  This gives a returned
  1608.         value larger than the actual file size.
  1609.      3) This call is used by the APPEND command in DOS 3.2+.
  1610.      4) Record numbers start with zero.
  1611.  
  1612.  
  1613. Function  24h  Set Relative Record Field                           (FCB)
  1614.      Set random record field specified by an FCB
  1615. entry   AH      24h
  1616.         DS:DX   address of an opened FCB
  1617. return  Random Record Field of FCB is set to be same as Current Block
  1618.         and Current Record.
  1619. note 1) You must invoke this function before performing random file
  1620.         access.
  1621.      2) The relative record field of FCB (offset 21h) is set to be same
  1622.         as the Current Block (offset 0Ch) and Current Record (offset
  1623.         20h).
  1624.      3) No error codes are returned.
  1625.      4) The FCB must already be opened.
  1626.  
  1627.  
  1628. Function  25h  Set Interrupt Vector
  1629. entry   AH      25h
  1630.         AL      interrupt number to reassign the handler to
  1631.         DS:DX   address of new interrupt vector
  1632. return  none
  1633. note 1) Registers are unchanged.
  1634.      2) No error codes are returned.
  1635.      3) The interrupt vector table for the interrupt number specified
  1636.         in AL is set to the address contained in DS:DX.  Use function
  1637.         35h (Get Vector) to get the contents of the interrupt vector
  1638.         and save it for later use.
  1639.      4) When you use function 25 to set an interrupt vector, DOS 3.2
  1640.         doesn't point the actual interrupt vector to what you requested.
  1641.         Instead, it sets the interrupt vector to point to a routine
  1642.         inside DOS, which does this:
  1643.                 1. Save old stack pointer
  1644.                 2. Switch to new stack pointer allocated from DOS's
  1645.                    stack pool
  1646.                 3. Call your routine
  1647.                 4. Restore old stack pointer
  1648.         The purpose for this was to avoid possible stack overflows when
  1649.         there are a large number of active interrupts.  IBM was
  1650.         concerned (this was an IBM change, not Microsoft) that on a
  1651.         Token Ring network there would be a lot of interrupts going on,
  1652.         and applications that hadn't allocated very much stack space
  1653.         would get clobbered.
  1654.      5) This call is explicitly supported in the OS/2 1.x
  1655.         Compatibility Box.
  1656.      6) This call is used to access the Phar Lap DOS extender's
  1657.         protected mode functions.  The Phar Lap function number is
  1658.         placed in AL.
  1659.  
  1660.  
  1661. Function  26h  Create New Program Segment Prefix (PSP)
  1662.      This service copies the current program-segment prefix to a new
  1663.      memory location for the creation of a new program or overlay.
  1664.      Once the new PSP is in place, a DOS program can read a DOS .COM
  1665.      or overlay file into the memory location immediately following
  1666.      the new PSP and pass control to it.
  1667. entry   AH      26h
  1668.         DX      segment number for the new PSP
  1669. return  Current PSP is copied to specified segment
  1670. note 1) Microsoft recommends you use the newer DOS service 4Bh (EXEC)
  1671.         instead.
  1672.      2) The entire 100h area at location 0 in the current PSP is copied
  1673.         into location 0 of the new PSP.  The memory size information at
  1674.         location 6 in the new segment is updated and the current
  1675.         termination, ctrl-break, and critical error addresses from the
  1676.         interrupt vector table entries for ints 22h, 23h, and 24 are
  1677.         saved in the new program segment starting at 0Ah.  They are
  1678.         restored from this area when the program terminates.
  1679.      3) The PSP structure is found in Chapter 6.
  1680.  
  1681.  
  1682. Function  27h  Random Block Read From File Specified by FCB
  1683.      Similar to 21h (Random Read) except allows multiple files to be
  1684.      read.
  1685. entry   AH      27h
  1686.         CX      number of records to be read
  1687.         DS:DX   address of an opened FCB
  1688. return  AL      00h     successful read
  1689.                 01h     end of file, no data read
  1690.                 02h     DTA too small for record size specified
  1691.                         (read canceled)
  1692.                 03h     end of file
  1693.         CX      actual number of records read (includes partial if
  1694.                 AL=03h)
  1695. note 1) The record size is specified in the FCB.  The service updates
  1696.         the Current Block (offset 0Ch) and Current Record (offset 20h)
  1697.         fields to the next record not read.
  1698.      2) If CX contained 0 on entry, this is a NOP.
  1699.      3) If the DTA is larger than the file, the file is padded to the
  1700.         requested length with zeroes.
  1701.      4) This function assumes that the FCB record size field (0Eh) is
  1702.         correctly set.  If not set by the user, the default is 128
  1703.         bytes.
  1704.      5) The record is written to disk at the current DTA address as
  1705.         specified by the most recent call to function 1Ah.  If the size
  1706.         of the record and location of the DTA are such that a segment
  1707.         overflow or wraparound would occur, the error return is set to
  1708.         AL=02h.
  1709.      6) Under networks running DOS 3.1 or later, the user must have
  1710.         Read access rights to the subdirectory.
  1711.  
  1712.  
  1713. Function  28h  Random Block Write to File Specified in FCB
  1714.      Similar to 27h (Random Write)     
  1715. entry   AH      28h
  1716.         CX      number of records to write
  1717.         DS:DX   address of an opened FCB
  1718. return  AL      00h     successful write
  1719.                 01h     disk full, no data written
  1720.                 02h     DTA too small for record size specified
  1721.                         (write canceled)
  1722.         CX      number of records written
  1723. note 1) The record size is specified in the FCB.
  1724.      2) This service allocates disk clusters as required.
  1725.      3) This function assumes that the FCB Record Size field (offset
  1726.         0Eh) is correctly set.  If not set by the user, the default is
  1727.         128 bytes.
  1728.      4) The record size is specified in the FCB.  The service updates
  1729.         the Current Block (offset 0Ch) and Current Record (offset 20h)
  1730.         fields to the next record not read.
  1731.      5) The record is written to disk at the current DTA address as
  1732.         specified by the most recent call to function 1Ah.  If the size
  1733.         of the record and location of the DTA are such that a segment
  1734.         overflow or wraparound would occur, the error return is set to
  1735.         AL=02h.
  1736.      6) If called with CX=0, no records are written, but the FCB's File
  1737.         Size entry (offset 1Ch) is set to the size specified by the
  1738.         FCB's Relative Record field (offset 21h).
  1739.      7) Under networks running DOS 3.1 or later, the user must have
  1740.         Write access rights to the subdirectory.
  1741.  
  1742.  
  1743. Function  29h  Parse the Command Line for Filename
  1744.      Parses a text string into the fields of a File Control Block
  1745. entry   AH      29h
  1746.         AL      bit mask to control parsing
  1747.             bit 0    0     parsing stops if file seperator found
  1748.                      1     causes service to scan past leading chars
  1749.                            such as blanks.  Otherwise assumes the
  1750.                            filename begins in the first byte
  1751.                 1    0     drive number in FCB set to default (0) if 
  1752.                            the string contains no drive number
  1753.                      1     drive number in FCB not changed
  1754.                 2    0     filename in FCB set to 8 blanks if no
  1755.                            filename in string
  1756.                      1     filename in FCB not changed if string does
  1757.                            not contain a filename
  1758.                 3    0     extension in FCB set to 3 blanks if no
  1759.                            extension in string
  1760.                      1     extension left unchanged
  1761.                 4-7  must be zero
  1762.         DS:SI   pointer to string to parse
  1763.         ES:DI   pointer to memory buffer to fill with unopened FCB
  1764. return  AL      00h     no wildcards in name or extension
  1765.                 01h     wildcards appeared in name or extension
  1766.                 0FFh    invalid drive specifier
  1767.         DS:SI   pointer to the first byte after the parsed string
  1768.         ES:DI   pointer to a buffer filled with the unopened FCB
  1769. note 1) If the * wildcard characters are found in the command line, this
  1770.         service will replace all subsequent chars in the FCB with
  1771.         question marks.
  1772.      2) This service uses the characters as filename separators
  1773.         DOS 1       : ; . , + / [ ] = " TAB SPACE
  1774.         DOS 2,3,4   : ; . , + = TAB SPACE
  1775.      3) This service uses the characters
  1776.         : ; . , + < > | / \ [ ] = " TAB SPACE
  1777.         or any control characters as valid filename separators.
  1778.      4) A filename cannot contain a filename terminator.  If one is
  1779.         encountered, all processing stops.  The handle functions will
  1780.         allow use of some of these characters.
  1781.      5) If no valid filename was found on the command line, ES:DI +1
  1782.         points to a blank (ASCII 32).
  1783.      6) This call will not handle pathnames.
  1784.      7) Parsing is in the form D:FILENAME.EXT.  If one is found, a
  1785.         corresponding unopened FCB is built at ES:DI.
  1786.  
  1787.  
  1788. Function  2Ah  Get Date
  1789.      Returns day of the week, year, month, and date
  1790. entry   AH      2Ah
  1791. return  CX      year    (1980-2099)
  1792.         DH      month   (1-12)
  1793.         DL      day     (1-31)
  1794.         AL      weekday 00h     Sunday
  1795.                         01h     Monday
  1796.                         02h     Tuesday
  1797.                         03h     Wednesday
  1798.                         04h     Thursday
  1799.                         05h     Friday
  1800.                         06h     Saturday
  1801. note 1) Date is adjusted automatically if clock rolls over to the next
  1802.         day, and takes leap years and number of days in each month into
  1803.         account.
  1804.      2) Although DOS cannot set an invalid date, it can read one, such
  1805.         as 91/32/80, etc.
  1806.      3) DESQview's DOS subfunctions also accept CX = 4445h and DX =
  1807.         5351h, i.e. 'DESQ' as valid.
  1808.      4) This call is explicitly supported in the OS/2 1.x
  1809.         Compatibility Box.
  1810.      5) DOS will accept CH=0 (midnight) as a valid time.  Through DOS
  1811.         3.31, if a file's time is set to within 2 seconds of midnight
  1812.         the time will not be displayed by the DIR command.  For DOS
  1813.         4.0+ and DR-DOS the creation time will always be displayed.
  1814.      6) TOS: $2A GET DATE.
  1815.  
  1816.  
  1817. Function  2Bh  Set Date
  1818.      set current system date
  1819. entry   AH      2Bh
  1820.         CX      year    (1980-2099)
  1821.         DH      month   (1-12)
  1822.         DL      day     (1-31)
  1823. return  AL      00h     no error (valid date)
  1824.                 0FFh    invalid date specified
  1825. note 1) On entry, CX:DX must have a valid date in the same format as
  1826.         returned by function call 2Ah.
  1827.      2) DOS 3.3+ also sets CMOS clock.
  1828.      3) Under the DESQview system shell, this is the DV_GET_VERSION
  1829.         check:
  1830.         entry   AH      2Bh
  1831.                 AL      01h     DESQ call
  1832.                 CX      4445h   'DE'               (invalid date used
  1833.                 DX      5351h   'SQ'                for DesQview ID)
  1834.         return  AH      major version
  1835.                 AL      minor version
  1836.                 AX      0FFh    DESQ not installed (DOS error code)
  1837.      4) For DESQview 2.00+, installation check
  1838.         entry   AH      2Bh
  1839.                 AL      subfunction (DV v2.00+)
  1840.                         01h     Get Version
  1841.         return  BX      version (BH = major, BL = minor)
  1842.         note    Early copies of v2.00 return 0002h.
  1843.                         02h     Get Shadow Buffer Info, and Start
  1844.                                 Shadowing
  1845.         return  BH      rows in shadow buffer
  1846.                 BL      columns in shadow buffer
  1847.                 DX      segment of shadow buffer
  1848.                         04h     Get Shadow Buffer Info
  1849.         return  BH      rows in shadow buffer
  1850.                 BL      columns in shadow buffer
  1851.                 DX      segment of shadow buffer
  1852.                         05h     Stop Shadowing
  1853.                 CX      4445h ('DE')
  1854.                 DX      5351h ('SQ')
  1855.         return  AL      0FFh    if DESQview not installed
  1856.         note    In DESQview v1.x, there were no subfunctions; this
  1857.                 call only identified whether or not DESQview was loaded.
  1858.      5) PC-Tools PC-Cache 5.1 (Multisoft cache) installation check.
  1859.         entry   CX      4358h ('CX')
  1860.         return  AL      00h     installed
  1861.                                 CX      6378h
  1862.                         0FFh    not installed
  1863.      6) This call is explicitly supported in the OS/2 1.x
  1864.         Compatibility Box.
  1865.      7) TOS: GET DATE.
  1866.  
  1867.  
  1868. Function  2Ch  Get Time
  1869.      Get current system time from CLOCK$ driver
  1870. entry   AH      2Ch
  1871. return  CH      hours   (0-23)
  1872.         CL      minutes (0-59)
  1873.         DH      seconds (0-59)
  1874.         DL      hundredths of a second (0-99)
  1875. note 1) Time is updated every 5/100 second.
  1876.      2) The date and time are in binary format.
  1877.      3) This call is explicitly supported in the OS/2 1.x
  1878.         Compatibility Box.
  1879.      4) TOS: GET TIME.
  1880.  
  1881.  
  1882. Function  2Dh  Set Time
  1883.      Sets current system time
  1884. entry   AH      2Dh
  1885.         CH      hours   (0-23)
  1886.         CL      minutes (0-59)
  1887.         DH      seconds (0-59)
  1888.         DL      hundredths of seconds (0-99)
  1889. return  AL      00h     if no error
  1890.                 0FFh    if bad value sent to routine
  1891. note 1) DOS 3.3+ also sets CMOS clock.
  1892.      2) CX and DX must contain a valid time in binary.
  1893.      3) This call is explicitly supported in the OS/2 1.x
  1894.         Compatibility Box.
  1895.      4) TOS: SET TIME.
  1896.  
  1897.  
  1898. Function  2Eh  Set/Reset Verify Switch
  1899.      Set verify flag
  1900. entry   AH      2Eh
  1901.         AL      00      to turn verify off (default)
  1902.                 01      to turn verify on
  1903.         DL      00h     (DOS 1.x and 2.x only, according to Microsoft's
  1904.                          MS-DOS Encyclopedia.  My IBM 2.0 and Intel 2.0
  1905.                          manuals don't show DL being used)
  1906. return  none
  1907. note 1) This is the call invoked by the DOS VERIFY command.
  1908.      2) The setting of the Verify switch can be obtained by calling
  1909.         function 54h.
  1910.      3) This call is not supported on network drives.
  1911.      4) DOS checks this flag each time it accesses a disk or block
  1912.         device.
  1913.      5) This call is explicitly supported in the OS/2 1.x
  1914.         Compatibility Box.
  1915.  
  1916.  
  1917. Function  2Fh  Get Disk Transfer Address (DTA)
  1918.      Returns current DTA used by all DOS read/write operations
  1919. entry   AH      2Fh
  1920. return  ES:BX   address of DTA
  1921. note 1) The DTA is set by function call 1Ah
  1922.      2) Default DTA address is a 128 byte buffer at offset 80h in that
  1923.         program's Program Segment Prefix.
  1924.      3) See Chapter 6 for a description of the DTA.
  1925.      4) This call is explicitly supported in the OS/2 1.x
  1926.         Compatibility Box.
  1927.      5) TOS: GET DTA. Returns segment address of current DTA in D0.
  1928.  
  1929.  
  1930. Function  30h  Get DOS Version Number
  1931.      Return DOS version and/or user number
  1932. entry   AH      30h
  1933.  (5.0+) AL      00h     Get OEM ID number
  1934.                 01h     Get version flag
  1935. return  AH      minor version number  (i.e., DOS 2.10 returns AX = 0A02h)
  1936.                                       (AH undefined for DOS 1.x)
  1937.         AL      major version number  (0 for DOS 1.x, 02h for 2.x, 05h
  1938.                                        for 5.x)
  1939.  
  1940. (DOS 2.0 through 4.01)
  1941.         BH      OEM ID number
  1942.                 00h     IBM DOS
  1943.                 16h     DEC DOS
  1944.                 0FFh    MS-DOS (generic) (Also Toshiba DOS 5.0)
  1945.  
  1946. (DOS 5.0+ called with AL=00h)
  1947.         BH      OEM ID number
  1948.                 (see above)
  1949.  
  1950. (DOS 5.0+ called with AL=01h)
  1951.         BH      version flag
  1952.                 08h     DOS 5.0 or higher running out of ROM
  1953.                         (all other bits are reserved and set to zero)
  1954.  
  1955.         BL:CX   24-bit user serial number (optional, OEM dependent.
  1956.                 If not used this field returns zeroes)
  1957. note 1) If AL returns a major version number of zero, the DOS version
  1958.         is below 1.28 for MSDOS and below 2.00 for PCDOS.
  1959.      2) IBM PC-DOS always returns 0000h in BX and CX, as does DR-DOS.
  1960.      3) Due to OS/2 returning version numbers over 10 and the fact
  1961.         that some European versions of DOS carried higher version
  1962.         numbers than IBM's DOS, utilities which check for a DOS version
  1963.         should not abort if a higher version than required is found
  1964.         unless some specific problems are known.
  1965.      4) This call is explicitly supported by the OS/2 1.x DOS
  1966.         Compatibility Box.
  1967.      5) TOS: $30 GET VERSION NUMBER.  Returns GEMDOS version number
  1968.         in D0.
  1969.      6) Under PC-MOS/386, if AX=BX=CX=DX, the PC-MOS/386 version number
  1970.         is returned.  If all registers to not hold the same value, an
  1971.         MSDOS equivalent version number is returned.  The PC-MOS/386
  1972.         version number is always different from the MSDOS version number.
  1973.      7) DOS version equivalents:
  1974.         3.20    PC-MOS/386 v3.0
  1975.         3.31    Digital Research DR-DOS 3.40, 3.41, 5.0, 6.0
  1976.         10      OS/2 v1.0 Compatibility Box  (major version number)
  1977.      8) DOS 5.0 adds the AL parameter to the command, but the ID number 
  1978.         returned in BL has been available since MSDOS 2.0, as
  1979.         documented by Intel's DOS 2.0 Technical Reference.
  1980.      9) DOS 5.0's SETVER command can modify the value returned in AX.
  1981.         You must use int 21h/3306h to obtain the true version number.
  1982.     10) OS/2 1.0's Compatibility Box returns version 10.  OS/2 1.1
  1983.         returns version 10.1, etc.  OS/2 2.0 returns version 20.
  1984.     11) If running in a Microsoft Windows 3.0 or later DOS box, the
  1985.         string "windir" will be in the DOS environment.  Note
  1986.         lowercase!
  1987.     12) It may sometimes be necessary to identify DOS-compatible
  1988.         operating systems or replacement command interpreters.  This
  1989.         doesn't appear to be a simple task.
  1990.  
  1991.         COMMAND.COM replacements:
  1992.         1) 4DOS can be identified with int 2Fh, fn 44DDh.
  1993.         2) Command Plus   (unknown)
  1994.         3) FlexShell      (unknown)
  1995.  
  1996.         DOS replacements:
  1997.         1) DR-DOS 3.4x has no easy way to be identified, which is a
  1998.            pity.  Though it has some MS4.0-like characteristics, it
  1999.            reports 3.31 with the DOS call, though VER will return
  2000.            whatever the DRDOS revision is.
  2001.            To identify DRDOS I've noted the following:
  2002.               The string "OS=" appears in the default 
  2003.                       environment (unless the user nulls it out)
  2004.               The OS= string is generated by COMMAND.COM and does not
  2005.                       appear when the user is running 4DOS as a command
  2006.                       interpreter.
  2007.               The internal DOS version call will report 3.31, but the
  2008.                       string returned by VER is at minimum 3.4.
  2009.              For DRDOS 3.x:
  2010.                SHARE and FASTOPEN are always loaded.
  2011.              For DRDOS 5 and 6:
  2012.                SHARE and FASTOPEN are NOT always loaded.
  2013.            The DR-DOS Programmer's Reference doesn't show a call to
  2014.                       identify DR-DOS specifically.
  2015.         2) PC-MOS/386: unknown. Fail an API call?
  2016.         3) Concurrent DOS: unknown. Fail an API call?
  2017.         4) DR Multiuser DOS inserts the string: OS=DRMDOS into the
  2018.                       environment.  Since DRMDOS doesn't allow
  2019.                       replacement of the command interpreter via the
  2020.                       SHELL= statement, OS= will be there unless nulled
  2021.                       by the user.
  2022.  
  2023. Function  31h  Terminate Process and Stay Resident      (KEEP)
  2024. entry   AH      31h
  2025.         AL      exit code
  2026.         DX      program memory requirement in 16 byte paragraphs
  2027. return  AX      return code (retrieveable by function 4Dh)
  2028. note 1) Files opened by the application are not closed when this call
  2029.         is made.
  2030.      2) Memory can be used more efficiently if the block containing the
  2031.         copy of the DOS environment is deallocated before terminating.
  2032.         This can be done by loading ES with the segment contained in 2Ch
  2033.         of the PSP and issuing function call 49h (Free Allocated Memory).
  2034.      3) Unlike int 27h, more than 64k may be made resident with this
  2035.         call.
  2036.      4) TOS: $31 KEEP PROCESS.
  2037.      5) Programs larger than 64k may be made resident with this call.
  2038.      6) For PC-MOS/386, tasks made resident with this call are subject
  2039.         to being swapped out of memory by the kernel for room to process
  2040.         other applications.  If your code needs to poll the keyboard or
  2041.         a port, you need to use a device driver instead.  PC-MOS does
  2042.         not swap device drivers.
  2043.  
  2044.  
  2045. Function  32h  Read DOS Disk Parameter Block
  2046.      Retrieve the pointer to the drive parameter block for a drive
  2047. entry   AH      32h
  2048.         DL      drive (0=default, 1=A:, etc.).
  2049. return  AL      0FFh    if drive is not valid or other error
  2050.                 00h     if drive is valid and:
  2051.         DS:BX   pointer to DOS Drive Parameter Table. Format of block:
  2052.               ┌────────┬──────┬────────────────────────────────────────
  2053.               │ Bytes  │ Type │                     Value
  2054.               ├────────┼──────┼────────────────────────────────────────
  2055.               │ 00h    │ byte │ Drive: 0=A:, 1=B:, etc.
  2056.               │ 01h    │ byte │ Unit within device driver (0, 1, 2, etc.)
  2057.               │ 02h-03h│ word │ Bytes per sector
  2058.               │ 04h    │ byte │ Sectors per cluster - 1
  2059.               │ 05h    │ byte │ Sectors per cluster as powers of 2
  2060.               │ 06h-07h│ word │ First sector containing FAT
  2061.               │ 08h    │ byte │ Number of copies of the FAT
  2062.               │ 09h-0Ah│ word │ Number of root directory entries
  2063.               │ 0Bh-0Ch│ word │ First sector of first cluster
  2064.               │ 0Dh-0Eh│ word │ Number of clusters on drive + 1
  2065.               ├────────┴──────┼────────────────────────────────────────
  2066.               │ DOS 2.x only  │
  2067.               ├────────┬──────┼────────────────────────────────────────
  2068.               │ 0Fh    │ byte │ Number of sectors for one copy of the FAT
  2069.               │ 10h-11h│ word │ Number of first sector of root directory
  2070.               │ 12h-15h│ dword│ Address of device driver header for this
  2071.               │        │      │ drive (beginning of device driver)
  2072.               │ 16h    │ byte │ Media Descriptor Byte for this drive
  2073.               │ 17h    │ byte │ 0FFh indicates block must be rebuilt
  2074.               │ 18h-1Bh│ dword│ address of next DOS Disk Block (0FFFFh
  2075.               │        │      │ means last in chain)
  2076.               │ 1Ch    │ word │ starting cluster of current dir (0 = root)
  2077.               │ 1Eh    │64byts│ ASCIIZ current directory path string
  2078.               ├────────┴──────┼────────────────────────────────────────
  2079.               │    DOS 3.x    │
  2080.               ├────────┬──────┼────────────────────────────────────────
  2081.               │ 0Fh    │ byte │ number of sectors in one FAT copy
  2082.               │ 10h    │ word │ first sector of root directory
  2083.               │ 12h    │dword │ address of device driver for this drive
  2084.               │ 16h    │ byte │ media descriptor byte for medium
  2085.               │ 17h    │ byte │ 0FFh = block must be rebuilt, 00h
  2086.               │        │      │ indicates block accessed
  2087.               │ 18h    │dword │ address of next device block, offset
  2088.               │        │      │ = 0FFFFh indicates last
  2089.               │ 1Ch    │ word │ cluster at which to start search for free
  2090.               │        │      │ space when writing
  2091.               │ 1Eh    │ word │ number of free clusters on drive, 0FFFFh
  2092.               │        │      │ unknown?
  2093.               ├────────┴──────┼────────────────────────────────────────
  2094.               │  DOS 4.0, 5.0 │  (from MS 5.0 TR)
  2095.               ├────────┬──────┼────────────────────────────────────────
  2096.               │ 0Fh    │ word │ number of sectors in one FAT copy
  2097.               │ 11h    │ word │ first sector of containing directory
  2098.               │ 13h    │dword │ address of device driver for this drive
  2099.               │ 17h    │ byte │ media descriptor byte for drive
  2100.               │ 18h    │ byte │ 0FFh = block must be rebuilt, 00h
  2101.               │        │      │ indicates block accessed
  2102.               │ 19h    │dword │ address of next device block, offset
  2103.               │        │      │  = 0FFFFh indicates last
  2104.               │ 1Dh    │ word │ last allocated cluster
  2105.               │ 1Fh    │ word │ number of free clusters on drive
  2106.               └────────┴──────┴────────────────────────────────────────
  2107. note 1) Use [BX+0Dh] to find no. of clusters (>1000h, 16-bit FAT; if
  2108.         not, 12-bit (exact dividing line is probably a little below
  2109.         1000h to allow for bad sectors, EOF markers, etc.)
  2110.      2) Short article by C.Petzold, PC Magazine  Vol.5, no.8.
  2111.      3) Some information from the article "Finding Disk Parameters" in
  2112.         the May 1986 issue of PC Tech Journal.
  2113.      4) This call is mostly supported in OS/2 1.0's DOS Compatibility
  2114.         Box.  The dword at 12h will not return the address of the next
  2115.         device driver when in the Compatibility Box.
  2116.      5) Used by CHKDSK.
  2117.  
  2118.  
  2119. Function  33h  Control-Break Check
  2120.      Get or set control-break checking at CON
  2121. entry   AH      33h
  2122.         AL      00h     see if ^C checking is active
  2123.                 01h     to set break checking
  2124.                         DL      00h     to disable break checking
  2125.                                 01h     to enable break checking
  2126.                 02h     internal, called by PRINT.COM (DOS 3.1)
  2127.                 03h     unknown
  2128.                 04h     unknown - DOS 4.0's CPSW command in CONFIG.SYS
  2129.                         calls this function
  2130.                 05h     (DOS 4.0+) get boot drive
  2131.                 06h     (DOS 5.0+) return "real" DOS version number
  2132.                         instead of number returned by SETVER/int 21h
  2133.                         fn 30h.
  2134. return  (if AL=00h)  break setting
  2135.         DL      00h     if break=off
  2136.                 01h     if break=on
  2137.  
  2138.         (if AL=05h)  boot drive
  2139.         DL      01h     A:
  2140.                 02h     B:  (etc.)
  2141.  
  2142.         (if AL=06h)  real DOS version
  2143.         BH      major version (05h=DOS5)
  2144.         BL      minor version (00h=.00)
  2145.         DH      0Bh     DOS is in ROM
  2146.                 10h     DOS is in HMA
  2147.         DL      DOS subversion number (0-7, VER/R reports as A-G)
  2148.  
  2149.         (all)
  2150.         AL      0FFh    error
  2151. note 1) This call is explicitly supported by the OS/2 1.x DOS
  2152.         Compatibility Box.
  2153.      2) When ^C checking is on, DOS checks for ^C after each DOS call.
  2154.         When off, DOS only checks after each DOS character I/O function
  2155.         from 01h to 0Ch.
  2156.  
  2157.  
  2158. Function  34h  Return INDOS Flag
  2159.      Returns ES:BX pointing to Critical Section Flag, byte indicating
  2160.      whether it is safe to interrupt DOS.
  2161. entry   AH      34h
  2162. return  ES:BX   points to 1-byte DOS "critical section flag"
  2163. note 1) If this byte is 0, it is safe to interrupt DOS.
  2164.      2) Supported OS/2 1.x Compatibility Box.
  2165.      3) For PC-MOS/386, this flag indicates whether MOS is using its
  2166.         stack or a task's stack.  If the flag is 0 it is safe to
  2167.         interrupt MOS.
  2168.  
  2169.  
  2170. Function  35h  Get Interrupt Vector
  2171.      Get interrupt vector
  2172. entry   AH      35h
  2173.         AL      interrupt number (hexadecimal)
  2174. return  ES:BX   address of interrupt vector
  2175. note 1) Use function call 25h to set the interrupt vectors.
  2176.      2) This call is explicitly supported by the OS/2 1.x DOS
  2177.         Compatibility Box.
  2178.  
  2179.  
  2180. Function  36h  Get Disk Free Space
  2181.      get information on specified drive
  2182. entry   AH      36h
  2183.         DL      drive number (0=default, 1=A:, 2=B:, etc)
  2184. return  AX      number of sectors per cluster
  2185.                 0FFFFh means drive specified in DL is invalid
  2186.         BX      number of available clusters
  2187.         CX      bytes per sector
  2188.         DX      clusters per drive
  2189. note 1) Multiply AX * CX * BX for free space on disk.
  2190.      2) Multiply AX * CX * DX for total disk space.
  2191.      3) Function 36h returns an incorrect value after an ASSIGN command.
  2192.         Prior to ASSIGN, the DX register contains 0943h on return, which
  2193.         is the free space in clusters on the HC diskette. After ASSIGN,
  2194.         even with no parameters, 0901h is returned in the DX register;
  2195.         this is an incorrect value.  Similar results occur with DD
  2196.         diskettes on a PC-XT or a PC-AT.  This occurs only when the disk
  2197.         is not the default drive.  Results are as expected when the
  2198.         drive is the default drive.  Therefore, the circumvention is to
  2199.         make the desired drive the default drive prior to issuing this
  2200.         function call.
  2201.      4) This function supercedes functions 1Bh and 1Ch.
  2202.      5) This call is explicitly supported by the OS/2 1.x DOS
  2203.         Compatibility Box.
  2204.      6) TOS: $36 GET DISK FREE SPACE.
  2205.  
  2206.  
  2207. Function  37h  SWITCHAR / AVAILDEV
  2208.  *   Get/set option marking character (is usually "/"), and device type
  2209. entry   AH      37h
  2210.         AL      00h     read switch character (returns current character
  2211.                         in DL)
  2212.                 01h     set character in DL as new switch character
  2213.     (DOS 2.x)   02h     read device availability (as set by function
  2214.                         AL=3) into DL.  A 0 means devices that devices
  2215.                         must be accessed in file I/O calls by /dev/device.
  2216.                         A non-zero value means that devices are
  2217.                         accessible at every level of the directory tree
  2218.                         (e.g., PRN is the printer and not a file PRN).
  2219.                         AL=2 to return flag in DL, AL=3 to set from DL
  2220.                         (0 = set, 1 = not set).
  2221.     (DOS 2.x)   03h     get device availability, where:
  2222.                         DL      00h     /dev/ must precede device names
  2223.                                 01h     /dev/ need not precede device
  2224.                                         names
  2225. return  DL      switch character (if AL=0 or 1)
  2226.                 device availability flag (if AL=2 or 3)
  2227.         AL      0FFh    the value in AL was not in the range 0-3
  2228. note 1) Functions 2 & 3 appear not to be implemented for DOS 3.x.
  2229.      2) It is documented on page 4.324 of the MS-DOS (version 2)
  2230.         Programmer's Utility Pack (Microsoft - published by Zenith).
  2231.      3) Works on all versions of IBM PC-DOS from 2.0 through 3.3.1.
  2232.      4) The SWITCHAR is the character used for "switches" in DOS command
  2233.         arguments (defaults to '/', as in "DIR/P"). '-' is popular to
  2234.         make a system look more like UNIX; if the SWITCHAR is anything
  2235.         other than '/', then '/' may be used instead of '\' for
  2236.         pathnames.
  2237.      5) Ignored by XCOPY, PKARC, LIST, used by PKZIP, LHARC.
  2238.      6) SWITCHAR may not be set to any character used in a filename.
  2239.         Legal filename characters vary in DOS 1.x through 6.x.
  2240.      7) In DOS 3.x you can still read the "AVAILDEV" byte with
  2241.         subfunction 02h but it always returns 0FFh even if you try to
  2242.         change it to 0 with subfunction 03h.
  2243.      8) AVAILDEV=0 means that devices must be referenced in an
  2244.         imaginary subdirectory "\dev" (similar to UNIX's /dev/*); a
  2245.         filename "PRN.DAT" can be created on disk and manipulated like
  2246.         any other.  If AVAILDEV != 0 then device names are recognized
  2247.         anywhere (this is the default): "PRN.DAT" is synonymous with
  2248.         "PRN:".
  2249.      9) These functions reportedly are not supported in the same
  2250.         fashion in various implementations of DOS.
  2251.     10) Used in DOS 3.3 by CHKDSK, BASIC, and DEBUG.
  2252.     11) SWITCHAR is not supported in the OS/2 1.x Compatibility Box.
  2253.     12) Not supported by the aftermarket 4DOS command interpreter in
  2254.         versions prior to 3.0.
  2255.     13) The MSDOS Encyclopedia reports: "XENIX used a forward slash as
  2256.         a separator, but versions 1.x of MS-DOS, borrowing from the
  2257.         tradition of DEC operating systems, already used the forward
  2258.         slash for switches on the command line, so Microsoft, at IBM's
  2259.         request, decided to use the backslash as the separator instead."
  2260.     14) SWITCHAR is not supported in MS-DOS 5.0.
  2261.  
  2262.  
  2263. Function  38h   Return Country-Dependent Information
  2264.                 (PCDOS 2.0, 2.1, MSDOS 2.00 only)
  2265. entry   AH      38h
  2266.         AL      function code  (must be 0 in DOS 2.x)
  2267.         DS:DX   pointer to 32 byte memory buffer for returned information
  2268. return  CF      set on error
  2269.                 AX      error code (02h)
  2270.         BX      country code
  2271.         DS:DX   pointer to buffer filled with country information:
  2272.           bytes 00h,01h date/time format
  2273.                         0000h   USA standard       H:M:S   M-D-Y
  2274.                         0001h   European standard  H:M:S   D/M/Y
  2275.                         0002h   Japanese standard  H:M:S   D:M:Y
  2276.                 02h     ASCIIZ string currency symbol
  2277.                 03h     byte of zeroes
  2278.                 04h     ASCIIZ string thousands separator
  2279.                 05h     byte of zeroes
  2280.                 06h     ASCIIZ string decimal separator
  2281.                 07h     byte of zeroes
  2282.        24 bytes 08h-1Fh reserved
  2283.  
  2284.  
  2285. Function  38h   Get Country-Dependent Information
  2286.                 (PCDOS 3.x+, MSDOS 2.01+)
  2287. entry   AH      38h
  2288.         AL      function code
  2289.                 00h     to get current country information
  2290.                 01h-0FEh country code to get information for, for
  2291.                         countries with codes less than 255
  2292.                 0FFh    to get country information for countries with
  2293.                         a code greater than 255
  2294.                         BX      16 bit country code if AL=0FFh
  2295.         DS:DX   pointer to the memory buffer where the data will be
  2296.                 returned
  2297.         DX      0FFFFh if setting country code rather than getting info
  2298. return  CF      0 (clear) function completed
  2299.                 1 (set) error
  2300.                         AX   error code
  2301.                              02h     invalid country code (no table
  2302.                                      for it)
  2303.         (if DX <> 0FFFFh)
  2304.         BX      country code (usually international telephone code)
  2305.         DS:DX   pointer to country data buffer
  2306.           bytes 0,1     date/time format
  2307.                         0       USA standard       H:M:S   M/D/Y
  2308.                         1       European standard  H:M:S   D/M/Y
  2309.                         2       Japanese standard  H:M:S   D:M:Y
  2310.           bytes 02h-06h ASCIIZ currency symbol
  2311.           byte  07h     ASCIIZ thousands separator
  2312.           byte  08h     byte of zeroes
  2313.           byte  09h     ASCIIZ decimal separator
  2314.           byte  0Ah     byte of zeroes
  2315.           byte  0Bh     ASCIIZ date separator
  2316.           byte  0Ch     byte of zeroes
  2317.           byte  0Dh     ASCIIZ time separator
  2318.           byte  0Eh     byte of zeroes
  2319.           byte  0Fh     currency format byte
  2320.                      bit 0      0  if currency symbol precedes the value
  2321.                                 1  if currency symbol is after the value
  2322.                          1      0  no spaces between value and currency
  2323.                                    symbol
  2324.                                 1  one space between value and currency
  2325.                                    symbol
  2326.                          2      1  if currency symbol replaces decimal
  2327.                                    point
  2328.                          3-7    not defined by Microsoft
  2329.           byte  10h     number of significant decimal digits in currency
  2330.                         (number of places to right of decimal point)
  2331.           byte  11h     time format byte
  2332.                     bit 0       0       12 hour clock
  2333.                                 1       24 hour clock
  2334.                         1-7     unknown, probably not used
  2335.           bytes 12h-15h address of case map routine (FAR CALL, AL=char
  2336.                                                      to map)
  2337.                         entry   AL  ASCII code of character to be
  2338.                                     converted to uppercase
  2339.                         return  AL  ASCII code of the uppercase input
  2340.                                     character
  2341.           byte  16h     data-list separator character
  2342.           byte  17h     zeroes
  2343.           bytes 18h-21h 5 words reserved
  2344. note 1) When an alternate keyboard handler is invoked, the keyboard
  2345.         routine is loaded into user memory starting at the lowest
  2346.         portion of available user memory.  The BIOS interrupt vector
  2347.         that services the keyboard is redirected to the memory area
  2348.         where the new routine resides.  Each new routine takes up about
  2349.         1.6K of memory and has lookup tables that return values unique
  2350.         to each language.  (KEYBxx in the DOS book)
  2351.           Once the keyboard interrupt vector is changed by the DOS
  2352.         keyboard routine, the new routine services all calls unless the
  2353.         system is returned to the US format by the ctrl-alt-F1 keystroke
  2354.         combination.  This does not change the interrupt vector back to
  2355.         the BIOS location; it merely passes the table lookup to the ROM
  2356.         locations.
  2357.      2) Ctrl-Alt-F1 will only change systems with US ROMS to the US
  2358.         layout.  Some systems are delivered with non-US keyboard
  2359.         handler routines in ROM.  (Amstrad machines)
  2360.      3) Case mapping call: the segment/offset of a FAR procedure that
  2361.         performs country-specific lower-to-upper case mapping on ASCII
  2362.         characters 80h to 0FFh.  It is called with the character to be
  2363.         mapped in AL.  If there is an uppercase code for the letter, it
  2364.         is returned in AL, if there is no code or the function was
  2365.         called with a value of less than 80h AL is returned unchanged.
  2366.      4) This call is fully implemented in MS-DOS version 2.01 and
  2367.         higher.  It is in version 2.00 but not fully implemented
  2368.         (according to Microsoft).
  2369.      5) This call is explicitly supported by the OS/2 1.x DOS
  2370.         Compatibility Box.
  2371.      6) For PC-MOS/386 native mode apps, use DS:EDX instead of DS:DX.
  2372.  
  2373.  
  2374. Function  38h   Set Country Dependent Information
  2375. entry   AH      38h
  2376.         AL      code    country code to set information for, for
  2377.                         countries with codes less than 255
  2378.                 0FFh    to set country information for countries with
  2379.                         a code greater than 255
  2380.         BX      16 bit country code if AL=0FFh
  2381.         DX      0FFFFh
  2382. return  CF      clear   successful
  2383.                 set     if error
  2384.                         AX      error code (02h)
  2385. note 1) Some country codes are:
  2386.         061     Australia       ("International English" in DOS 5.0)
  2387.         032     Belgium
  2388.         055     Brazil          (DOS 5.0)
  2389.         002     French-Canadian
  2390.         042     Czechoslovakia  (DOS 5.0)
  2391.         045     Denmark
  2392.         358     Finland
  2393.         033     France
  2394.         049     Germany  
  2395.         036     Hungary         (DOS 5.0)
  2396.         972     Israel
  2397.         039     Italy
  2398.         081     Japan
  2399.         758     Middle East
  2400.         031     Netherlands
  2401.         047     Norway
  2402.         048     Poland          (DOS 5.0)
  2403.         351     Portugal
  2404.         003     Latin America
  2405.         034     Spain
  2406.         046     Sweden
  2407.         041     Switzerland
  2408.         088     Taiwan          (MS 4.0+, but not DRDOS 5 or 6)
  2409.         044     U.K.
  2410.         001     USA
  2411.         038     Yugoslavia      (DOS 5.0)
  2412.      2) The country code is the same as the 3-digit international
  2413.         telephone code for that country.
  2414.      3) The documentation for COUNTRY= will tell you which codes are
  2415.         valid for your particular DOS version.  Different OEM
  2416.         implementations of the same DOS version may not support the
  2417.         same countries.
  2418.      4) TSL offers support for developing special country code drivers
  2419.         for PC-MOS/386.  Version 4.10 comes with:
  2420.         061     Australia
  2421.         032     Belgium
  2422.         002     French-Canadian
  2423.         045     Denmark
  2424.         358     Finland
  2425.         033     France
  2426.         049     Germany  
  2427.         972     Israel
  2428.         039     Italy
  2429.         758     Middle East
  2430.         031     Netherlands
  2431.         047     Norway
  2432.         351     Portugal
  2433.         034     Spain
  2434.         046     Sweden
  2435.         041     Switzerland
  2436.         044     U.K.
  2437.         001     USA
  2438.      5) For PC-MOS/386 native mode apps, use DS:EDX instead of DS:DX.
  2439.  
  2440.  
  2441. Function  39h   Create Subdirectory                     (MKDIR)
  2442.                 Makes a subdirectory along the indicated path
  2443. entry   AH      39h
  2444.         DS:DX   address of ASCIIZ directory pathname string
  2445. return  flag CF 0       successful
  2446.                 1       error
  2447.                         AX      error code if any  (03h, 05h)
  2448.                                         (DOS 5.0)  (02h, 03h, 05h)
  2449. note 1) The ASCIIZ string contains the drive and subdirectory.
  2450.      2) Drive may be any valid drive (not necessarily current drive).
  2451.      3) The pathname cannot exceed 64 characters.  (same with
  2452.         PC-MOS/386)
  2453.      4) This call is explicitly supported by the OS/2 1.x DOS
  2454.         Compatibility Box.
  2455.      5) The characters [, ] , =, and " may not be used in subdirectory
  2456.         names.
  2457.      6) TOS: $39 MKDIR.
  2458.      7) For DOS 3.1+ networks, the user must have Create access to the
  2459.         subdirectory.
  2460.      8) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2461.  
  2462.  
  2463. Function  3Ah   Remove Subdirectory                     (RMDIR)
  2464. entry   AH      3Ah
  2465.         DS:DX   address of ASCIIZ pathname string
  2466. return  CF      clear     successful
  2467.                 set       AX      error code if any  (03h, 05h, 10h)
  2468. note 1) The ASCIIZ string contains the drive and subdirectory.
  2469.      2) Drive may be any valid drive (not necessarily current drive).
  2470.      3) The pathname cannot exceed 64 characters.
  2471.      4) This call is explicitly supported by the OS/2 1.x DOS
  2472.         Compatibility Box.
  2473.      5) TOS: $3A RMDIR.
  2474.      7) For DOS 3.1+ networks, the user must have Delete access to the
  2475.         subdirectory.
  2476.      8) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2477.  
  2478.  
  2479. Function  3Bh   Change Current Directory                (CHDIR)
  2480. entry   AH      3Bh
  2481.         DS:DX   address of ASCIIZ string
  2482. return  flag CF 0       successful
  2483.                 1       error
  2484.         AX      error code if any (03h)
  2485. note 1) The pathname cannot exceed 64 characters including separators.
  2486.      2) The ASCIIZ string may contain drive and subdirectory.
  2487.      3) Drive may be any valid drive (not necessarily current drive).
  2488.         This call will not change the current logged drive.
  2489.      4) This call is explicitly supported by the OS/2 1.x DOS
  2490.         Compatibility Box.
  2491.      5) TOS: $3B CHDIR.
  2492.      6) The pathspec may not contain wildcards.
  2493.      7) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2494.  
  2495.  
  2496. Function  3Ch   Create A File                           (CREAT)
  2497.                 Create a file with handle
  2498. entry   AH      3Ch
  2499.         CX      byte, attributes for file
  2500.                 00h     normal read/write
  2501.                 01h     read only
  2502.                 02h     hidden
  2503.                 04h     system
  2504.                 08h     volume label
  2505.                 20h     archive bit
  2506.         DS:DX   address of ASCIIZ filename string
  2507. return  CF      0       successful creation
  2508.                 1       error
  2509.         AX      16 bit file handle
  2510.                 or error code  (03h, 04h, 05h)
  2511. note 1) The ASCIIZ string may contain drive and subdirectory.
  2512.      2) Drive may be any valid drive (not necessarily current drive).
  2513.      3) If the volume label or subdirectory bits are set in CX, they are
  2514.         ignored.
  2515.      4) The file is opened in read/write mode
  2516.      5) If the file does not exist, it is created. If one of the same
  2517.         name exists, it is truncated to a length of 0.
  2518.      6) Good practice is to attempt to open a file with fn 3Dh and jump
  2519.         to an error routine if successful, create file if 3Dh fails.
  2520.         That way an existing file will not be truncated and overwritten.
  2521.      7) If the application will run only on DOS 3.x or higher, fn 5Bh
  2522.         should be used as it automatically creates the file if it does
  2523.         not exist, preventing problems with networks or multitaskers.
  2524.      8) This call is explicitly supported by the OS/2 1.x DOS
  2525.         Compatibility Box.
  2526.      9) TOS: $3C CREAT.
  2527.     10) For DOS 3.1+ networks, the user must have Create access to the
  2528.         subdirectory.
  2529.     11) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2530.  
  2531.  
  2532. Function  3Dh   Open A File
  2533.                 Open disk file with handle
  2534. entry   AH      3Dh
  2535.         AL      access code byte
  2536. (DOS 2.x)  bits 0-2     file attribute
  2537.                         000     read only
  2538.                         001     write only
  2539.                         010     read/write (default)
  2540.                 3-7     reserved, should be set to zero
  2541. (DOS 3.x)  bits 0-2     file attribute
  2542.                         000     read only
  2543.                         001     write only
  2544.                         010     read/write (default)
  2545.                 3       reserved, should be set to zero
  2546.                 4-6     sharing mode (network)
  2547.                         000     compatibility mode       (default)
  2548.                         001     read/write access denied (exclusive)
  2549.                         010     write access denied
  2550.                         011     read access denied
  2551.                         100     full access permitted
  2552.                 7       inheritance flag
  2553.                         0       file inherited by child process
  2554.                         1       file private to child process
  2555.         DS:DX   address of ASCIIZ drive/path/filename string
  2556. return  CF set on error
  2557.                 AX      error code - MS-DOS (01h, 02h, 03h, 04h, 05h,
  2558.                                             0Ch)
  2559.                                    - DR-DOS (02h, 04h, 05h, 0Ch) and
  2560.                                             MS-DOS 5.0
  2561.         AX      16 bit DOS file handle
  2562. note 1) Opens any normal, system, or hidden file.
  2563.      2) Files that end in a colon are not opened.
  2564.      3) The read/write pointer is set at the first byte of the file and
  2565.         the record size of the file is 1 byte (the read/write pointer
  2566.         can be changed through function call 42h).  The returned file
  2567.         handle must be used for all subsequent input and output to the
  2568.         file.
  2569.      4) If the file handle was inherited from a parent process or was
  2570.         duplicated by DUP or FORCEDUP, all sharing and access
  2571.         restrictions are also inherited.
  2572.      5) A file sharing error (error 01h) causes an int 24h to execute
  2573.         with an error code of 02h.
  2574.      6) This call is explicitly supported by the OS/2 1.x DOS
  2575.         Compatibility Box.
  2576.      7) TOS: $3D OPEN.
  2577.      8) If any process opens a file that denies a level of access, all
  2578.         subsequent requests to open the file at that level of access
  2579.         will fail.
  2580.      9) Any attempt to open a file with a sharing mode that is already
  2581.         breached by an existing process will always fail.
  2582.     10) Used by APPEND in DOS 3.2,+.
  2583.     11) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2584.  
  2585.  
  2586. Function  3Eh   Close A File Handle
  2587.                 Close a file and release handle for reuse
  2588. entry   AH      3Eh
  2589.         BX      file handle (generated by 3Dh)
  2590. return  flag CF clear   successful close
  2591.                 set     error
  2592.         AX      error code if error (06h)
  2593. note 1) When executed, the file is closed, the directory is updated,
  2594.         and all buffers for that file are flushed.  If the file was
  2595.         changed, the time and date stamps are changed to reflect the
  2596.         current time.
  2597.      2) If called with the handle 00000h, it will close STDIN (normally
  2598.         the keyboard).
  2599.      3) This call is explicitly supported by the OS/2 1.x DOS
  2600.         Compatibility Box.
  2601.      4) TOS: $3E CLOSE.
  2602.      5) In most versions of DOS only 15 file handles are available for
  2603.         user processes.  It is good practice to close a file handle
  2604.         when you are not using it.
  2605.      6) For DOS 3.1+ networks, all file locks must be removed before
  2606.         the file is closed.  Closing a file with active locks is
  2607.         unpredictable.
  2608.      7) Although closing a file invalidates the corresponding handle,
  2609.         DOS may reuse the handle to identify a file that is subsequently
  2610.         opened or created.  You can use int 21h/440Ah (Is File or Device
  2611.         Remote) to tell if a given handle is valid.
  2612.      
  2613.  
  2614. Function  3Fh   Read From A File Or Device
  2615.                 Read from file with handle
  2616. entry   AH      3Fh
  2617.         BX      file handle
  2618.         CX      number of bytes to read
  2619.         DS:DX   address of buffer
  2620. return  flag CF clear   successful read
  2621.                 set     error
  2622.         AX      00h     pointer was already at end of file
  2623.                      or number of bytes read
  2624.                      or error code (05h, 06h)
  2625. note 1) This function attempts to transfer the number of bytes specified
  2626.         in CX to a buffer location.  It is not guaranteed that all bytes
  2627.         will be read.
  2628.      2) If performed from STDIN (file handle 0000), the input can be
  2629.         redirected.
  2630.      3) If used to read the keyboard, it will only read to the first CR.
  2631.      4) The file pointer is incremented to the last byte read.
  2632.      5) This call is explicitly supported by the OS/2 1.x DOS
  2633.         Compatibility Box.
  2634.      6) TOS: $3F READ.
  2635.      7) If AX < CX a partial record was read.
  2636.      8) For DOS 3.1+ networks, the user must have Read access to the
  2637.         subdirectory.
  2638.     11) For PC-MOS/386 native mode, use DS:EDX and ECX instead of DS:DX
  2639.         and CX.
  2640.  
  2641.  
  2642. Function  40h   Write To A File Or Device
  2643.                 Write to file with handle
  2644. entry   AH      40h
  2645.         BX      file handle
  2646.         CX      number of bytes to write
  2647.         DS:DX   address of buffer
  2648. return  CF      clear   successful write
  2649.                 set     error
  2650.         AX      number of bytes written
  2651.                 or error code  (05h, 06h)
  2652. note 1) This call attempts to transfer the number of bytes indicated
  2653.         in CX from a buffer to a file.  If CX and AX do not match after
  2654.         the write, an error has taken place; however no error code will
  2655.         be returned for this problem.  This is usually caused by a full
  2656.         disk.
  2657.      2) If the write is performed to STDOUT (handle 0001), it may be
  2658.         redirected.
  2659.      3) To truncate the file at the current position of the file
  2660.         pointer, set the number of bytes in CX to zero before calling
  2661.         int 21h.  The pointer can be moved to any desired position with
  2662.         function 42h.
  2663.      4) This function will not write to a file or device marked
  2664.         read-only.
  2665.      5) May also be used to display strings to CON instead of fn 09h.
  2666.         This function will write CX bytes and stop; fn 09h will
  2667.         continue to write until a '$' character is found.
  2668.      6) This is the call that DOS actually uses to write to the screen
  2669.         in DOS 2.x and above.
  2670.      7) This call is explicitly supported by the OS/2 1.x DOS
  2671.         Compatibility Box.
  2672.      8) TOS: $40 WRITE.
  2673.      9) For PC-MOS/386 native mode, use DS:EDX and ECX instead of DS:DX
  2674.         and CX.
  2675.  
  2676.  
  2677. Function  41h   Delete A File From A Specified Subdirectory  (UNLINK)
  2678. entry   AH      41h
  2679.         DS:DX   pointer to ASCIIZ filespec to delete
  2680. return  CF      clear   successful
  2681.                 set     error
  2682.                 AX      error code if any  (02h, 05h)
  2683. note 1) This function will not work on a file marked read-only.
  2684.      2) Wildcards are not accepted.
  2685.      3) For deleting multiple files, function 13h is faster.
  2686.      4) This call is explicitly supported by the OS/2 1.x DOS
  2687.         Compatibility Box.
  2688.      5) TOS: $41 UNLINK.
  2689.      6) For DOS 3.1+ networks, the user must have Delete access to the
  2690.         subdirectory.
  2691.      7) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2692.  
  2693.  
  2694. Function  42h   Move a File Read/Write Pointer               (LSEEK)
  2695. entry   AH      42h
  2696.         AL      method code byte
  2697.                 00h     offset from beginning of file
  2698.                 01h     offset from present location
  2699.                 02h     offset from end of file
  2700.         BX      file handle
  2701.         CX:DX   offset into file (high/low word) in bytes
  2702. return  AX:DX   new file pointer (segment/offset)
  2703.         CF      set     error
  2704.                         AX      error code (01h, 06h)
  2705.                 clear   successful move
  2706. note 1) If pointer is at end of file, reflects file size in bytes.
  2707.      2) The value in DX:AX is the absolute 32 bit byte offset from the
  2708.         beginning of the file.
  2709.      3) This call is explicitly supported by the OS/2 1.x DOS
  2710.         Compatibility Box.
  2711.      4) TOS: $42 LSEEK.
  2712.      5) File most be open.
  2713.      6) For PC-MOS/386 native mode, use ECX instead of CX.
  2714.  
  2715.  
  2716. Function   43h  Get/Set file attributes                 (CHMOD)
  2717. entry   AH      43h
  2718.         AL      00h     get file attributes
  2719.                 01h     set file attributes
  2720.                 CX      file attributes to set
  2721.                     bit 0       read only
  2722.                         1       hidden file
  2723.                         2       system file
  2724.                         3       volume label
  2725.                         4       subdirectory
  2726.                         5       written since backup (archive bit)
  2727.                         6,7     not used
  2728.                         8       shareable (Novell NetWare)
  2729.                         9-F     not used
  2730.         DS:DX   segment/offset pointer to full ASCIIZ file name
  2731. return  CF      set if error
  2732.                 AX      error code - MSDOS (01h, 02h, 03h, 05h)
  2733.                                      DRDOS (02h, 03h, 05h)
  2734.         CX      file attributes on get
  2735.                 attributes:
  2736.                 00h     normal
  2737.                 01h     read only
  2738.                 02h     hidden
  2739.                 04h     system
  2740.                 08h     volume label
  2741.                 10h     file is subdirectory
  2742.                 20h     archive
  2743. note 1) This call will not change the volume label or directory bits.
  2744.      2) Any combination of file attributes may be used.
  2745.      3) This call is explicitly supported by the OS/2 1.x DOS
  2746.         Compatibility Box.
  2747.      4) TOS: $43 CHANGE MODE (CHMOD).
  2748.      5) For DOS 3.1+ networks, the user must have Create access to the
  2749.         subdirectory.
  2750.      6) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  2751.  
  2752.  
  2753. Function  44h   I/O Control for Devices                 (IOCTL)
  2754.         provided with full version of DOSREF
  2755.  
  2756.  
  2757. Function  45h   Duplicate a File Handle                 (DUP)
  2758. entry   AH      45h
  2759.         BX      file handle to duplicate
  2760. return  CF      clear   AX      duplicate handle
  2761.                 set     AX      error code  (04h, 06h)
  2762. note 1) If you move the pointer of one handle with 3Fh (Read), 40h
  2763.         (Write), or 42h (Move Pointer) the pointer of the other will
  2764.         also be moved.
  2765.      2) The handle in BX must be open.
  2766.      3) This call is explicitly supported by the OS/2 1.x DOS
  2767.         Compatibility Box.
  2768.      4) TOS: $45 DUP.
  2769.      5) This call can be used to update the directory entry of a file
  2770.         without the overhead of opening and closing it.  For example,
  2771.         this call followed by fn 3Eh (Close File) with the duplicate
  2772.         file handle will cause DOS to flush its buffers and update the
  2773.         directory entry while the original file remains open in read/
  2774.         write mode.
  2775.  
  2776.  
  2777. Function  46h   Force Duplicate of a Handle          (FORCEDUP or CDUP)
  2778.                 Forces handle in CX to refer to the same file at the
  2779.                 same position as BX
  2780. entry   AH      46h
  2781.         BX      existing open file handle to duplicate
  2782.         CX      new file handle
  2783. return  CF      clear   both handles now refer to existing file
  2784.                 set     error
  2785.                 AX      error code (04h, 06h)
  2786. note 1) If CX was an open file, it is closed first.
  2787.      2) If you move the pointer of one handle with 3Fh (Read), 40h
  2788.         (Write), or 42h (Move Pointer) the pointer of the other will
  2789.         also be moved.
  2790.      3) The handle in BX must be open.
  2791.      4) This call is explicitly supported by the OS/2 1.x DOS
  2792.         Compatibility Box.
  2793.      5) TOS $46 FORCE.
  2794.      6) This call may be used for redirecting input and output.
  2795.  
  2796.  
  2797. Function  47h   Get Current Directory
  2798.                 Places full pathname of current directory/drive into
  2799.                 a buffer
  2800. entry   AH      47h
  2801.         DL      drive (0=default, 1=A:, etc.)
  2802.         DS:SI   segment/offset pointer to 64-byte buffer area
  2803. return  CF      clear   DS:DI   pointer to ASCIIZ pathname of the current
  2804.                                 directory
  2805.                 set     AX      error code (0Fh)
  2806. note 1) String does not begin with a drive identifier or a backslash.
  2807.      2) This call is explicitly supported by the OS/2 1.x DOS
  2808.         Compatibility Box.
  2809.      3) TOS: $47 GETDIR.
  2810.      4) For PC-MOS/386 native mode, use DS:ESI instead of DS:SI.
  2811.  
  2812.  
  2813. Function  48h   Allocate Memory                         (MALLOC)
  2814.                 Allocates the requested number of 16-byte paragraphs
  2815.                 of memory
  2816. entry   AH      48h
  2817.         BX      number of 16-byte paragraphs desired
  2818. return  CF      clear   AX      segment address of allocated space
  2819.                         BX      maximum number paragraphs available
  2820.                 set     AX      error code (07h, 08h)
  2821. note 1) BX indicates maximum memory available only if allocation fails.
  2822.      2) This call is explicitly supported by the OS/2 1.x DOS
  2823.         Compatibility Box.
  2824.      3) TOS: $48 MALLOC.
  2825.      4) Native-mode PC-MOS/386 applications allocate memory via MOS'
  2826.         interrupt 0D4h API function 11h.
  2827.      5) When in TopView this call is checked to ensure none of the
  2828.         addresses are outside the application's memory partition.
  2829.  
  2830.  
  2831. Function  49h   Free Allocated Memory
  2832.                 Frees specified memory blocks
  2833. entry   AH      49h
  2834.         ES      segment address of area to be freed
  2835. return  CF      clear   successful
  2836.                 set     AX      error code (07h, 09h)
  2837. note 1) This call is only valid when freeing memory obtained by
  2838.         function 48h.
  2839.      2) A program should not try to release memory not belonging to it.
  2840.      3) This call is explicitly supported by the OS/2 1.x DOS
  2841.         Compatibility Box.
  2842.      4) TOS: $49 MFREE.
  2843.      5) Native-mode PC-MOS/386 applications allocate memory via MOS'
  2844.         interrupt 0D4h API function 12h.
  2845.      6) When in TopView this call is checked to ensure none of the
  2846.         addresses are outside the application's memory partition.
  2847.  
  2848.  
  2849. Function  4Ah   Modify Allocated Memory Blocks          (SETBLOCK)
  2850.                 Expand or shrink memory for a program
  2851. entry   AH      4Ah
  2852.         BX      new size in 16 byte paragraphs
  2853.         ES      segment address of block to change
  2854. return  CF      clear   nothing
  2855.                 set     AX      error code (07h, 08h, 09h)
  2856.                     or  BX      maximum number of paragraphs available
  2857. note 1) Max number paragraphs available is returned only if the call
  2858.         fails.
  2859.      2) Memory can be expanded only if there is memory available.
  2860.      3) This call is explicitly supported by the OS/2 1.x DOS
  2861.         Compatibility Box.
  2862.      4) TOS: $4A SETBLOCK.
  2863.      5) Native-mode PC-MOS/386 applications allocate memory via MOS'
  2864.         interrupt 0D4h API function 12h.
  2865.      6) When in TopView this call is checked to ensure none of the
  2866.         addresses are outside the application's memory partition.
  2867.  
  2868.  
  2869. Function  4Bh   Load or Execute a Program                  (EXEC)
  2870. entry   AH      4Bh
  2871.         AL      00h     load and execute program.  A PSP is built for
  2872.                         the program the ctrl-break and terminate
  2873.                         addresses are set to the new PSP.
  2874.   (DOS 5.0)    *01h     load but don't execute (internal, DOS 3.x &
  2875.                         DESQview)    (see note 1)
  2876.                *02h     load but do not execute (internal,
  2877.                         DOS 2.x only)
  2878.                 03h     load overlay (do not create PSP, do not begin
  2879.                         execution)
  2880.                *04h     start async process (Euro-DOS 4.0 only)
  2881.                         (see note 12)
  2882.   (DOS 5.0)     05h     EnterExecState API (see note 17)
  2883.         DS:DX   segment/offset pointer to the ASCIIZ string with the
  2884.                 drive, path, and filename to be loaded
  2885.         ES:BX   segment/offset pointer to a parameter block for the load
  2886.                (AL=00h) word    segment address of environment string
  2887.                                 to be passed (0=use current)
  2888.                        dword    pointer to the command line to be
  2889.                                 placed at PSP+80h
  2890.                        dword    pointer to default FCB to be passed at
  2891.                                 PSP+5Ch
  2892.                        dword    pointer to default FCB to be passed at
  2893.                                 PSP+6Ch
  2894.               (*AL=01h) word    segment of environment (0 = use current)
  2895.                        dword    pointer to command line
  2896.                        dword    pointer to FCB 1
  2897.                        dword    pointer to FCB 2
  2898.          (DOS 3.x+)    dword    will hold SS:SP on return
  2899.          (DOS 3.x+)    dword    will hold program entry point (CS:IP) on
  2900.                                 return
  2901.               (*AL=02h) word    segment of environment (0 = use current)
  2902.                        dword    pointer to command line
  2903.                        dword    pointer to FCB 1
  2904.                        dword    pointer to FCB 2
  2905.                (AL=03h) word    segment address where file will be
  2906.                                 loaded
  2907.                         word    relocation factor to be applied to the
  2908.                                 image
  2909. return  CF      set     error
  2910.                         AX      error code (01h - 05h, 08h, 0Ah, 0Bh)
  2911.         CF      clear   if successful
  2912.                 for fn 00h, process ID set to new program's PSP; get
  2913.                         with function 62h
  2914.                 for fn 01h and DOS 3.x+ or DESQview, process ID set
  2915.                         to new program's PSP; get with function 62h
  2916.                 for fn 01h and DOS 2.x, new program's initial stack
  2917.                         and entry point returned in registers
  2918.                 for fn 02h, new program's initial stack and entry point
  2919.                         are returned in the registers
  2920. note 1) If you make this call with AL=1 the program will be loaded as
  2921.         if you made the call with AL=0 except that the program will not
  2922.         be executed.  Additionally, with AL=1 the stack segment and
  2923.         pointer along with the program's CS:IP entry point are returned
  2924.         to the program which made the 4B01h call.  These values are put
  2925.         in the four words at ES:BX+0Eh.  On entry to the call ES:BX
  2926.         points to the environment address, the command line and the
  2927.         two default FCBs.  This form of EXEC is used by DEBUG.COM.
  2928.      2) Application programs may invoke a secondary copy of the command
  2929.         processor (normally COMMAND.COM) by using the EXEC function.
  2930.         Your program may pass a DOS command as a parameter that the
  2931.         secondary command processor will execute as though it had been
  2932.         entered from the standard input device.
  2933.         The procedure is:
  2934.          A. Assure that adequate free memory (17k for 2.x and 3.0, 23k
  2935.             for 3.1) exists to contain the second copy of the command
  2936.             processor and the command it is to execute.  This is
  2937.             accomplished by executing function call 4Ah to shrink memory
  2938.             allocated to that of your current requirements.  Next,
  2939.             execute function call 48h with BX=0FFFFh.  This returns the
  2940.             amount of memory available.
  2941.         B. Build a parameter string for the secondary command processor
  2942.            in the form:
  2943.                          1 byte   length of parameter string
  2944.                         xx bytes  parameter string
  2945.                          1 byte   0Dh (carriage return)
  2946.            For example, the assembly language statement below would
  2947.            build the string to cause execution of the command FOO.EXE:
  2948.                               DB 19,"/C C:FOO",13
  2949.         C. Use the EXEC function call (4Bh), function value 0 to cause
  2950.            execution of the secondary copy of the command processor.
  2951.            (The drive, directory, and name of the command processor can
  2952.            be obtained from the COMSPEC variable in the DOS environment
  2953.            passed to you at PSP+2Ch.)
  2954.         D. Remember to set offset 2 of the EXEC control block to point
  2955.            to the string built above.
  2956.      3) All open files of a process are duplicated in the newly created
  2957.         process after an EXEC, except for files originally opened with
  2958.         the inheritance bit set to 1.
  2959.      4) The environment is a copy of the original command processor's
  2960.         environment.  Changes to the EXECed environment are not passed
  2961.         back to the original.  The environment is followed by a copy of
  2962.         the DS:DX filename passed to the child process.  A zero value
  2963.         will cause the child process to inherit the environment of the
  2964.         calling process.  The segment address of the environment is
  2965.         placed at offset 2Ch of the PSP of the program being invoked.
  2966.      5) This function uses the same resident part of COMMAND.COM, but
  2967.         makes a duplicate of the transient part.
  2968.      6) How EXEC knows where to return to: Basically the vector for int
  2969.         22h holds the Terminate address for the current process.  When
  2970.         a process gets started, the previous contents of int 22h get
  2971.         tucked away in the PSP for that process, then int 22h gets
  2972.         modified.  So if Process A EXECs process B, while Process B is
  2973.         running, the vector for int 22h holds the address to return to
  2974.         in Process A, while the save location in Process B's PSP holds
  2975.         the address that process A will return to when *it* terminates.
  2976.         When Process B terminates by one of the usual legal means, the
  2977.         contents of int 22h are (surmising) shoved onto the stack, the
  2978.         old terminate vector contents are copied back to int 22h vector
  2979.         from Process B's PSP, then a RETF or equivalent is executed to
  2980.         return control to process A.
  2981.      7) To load an overlay file with 4B: first, don't de-allocate the
  2982.         memory that the overlay will load into.  With the other 4Bh
  2983.         functions, the opposite is true - you have to free the memory
  2984.         first, with function 4Ah.  Second, the "segment address where
  2985.         the file will be loaded" (first item in the parameter block for
  2986.         sub-function 03) should be a paragraph boundary within your
  2987.         currently-allocated memory.  Third, if the procedures within
  2988.         the overlay are FAR procs (while they execute, CS will be
  2989.         equal to the segment address of the overlay area), the
  2990.         relocation factor should be set to zero.  On the other hand,
  2991.         if the CS register will be different from the overlay area's
  2992.         segment address, the relocation factor should be set to
  2993.         represent the difference.  You determine where in memory the
  2994.         overlay file will load by using the segment address mentioned
  2995.         above.  Overlay files are .EXEs (containing header, relocation
  2996.         table, and memory image).
  2997.      8) When function 00h returns, all registers are changed,
  2998.         including the stack.  You must resore SS, SP, and any other
  2999.         required registers.
  3000.      9) PCDOS EXEC function 3 (overlay) lives in the transient piece
  3001.         of COMMAND.COM and gets loaded when needed, thus the
  3002.         requirement for enough free space to load the EXEC loader
  3003.         (about 1.5k).  Under MS-DOS the EXEC system call lives in
  3004.         the system space.
  3005.     10) If you try to overlay an .EXE file with the high/low switch set
  3006.         to load the in the upper end of memory nothing will happen.
  3007.         The high/low switch is only for process creation, not for
  3008.         overlays.
  3009.     11) DOS 2.x destroys all registers, including SS:SP.
  3010.     12) (AL=04h) This is DOS 4.0 as released in 1987 to various
  3011.         European OEMs.  It is not related to US DOS 4.0.
  3012.     13) This call is explicitly supported by the OS/2 1.x DOS
  3013.         Compatibility Box.
  3014.     14) TOS: $4B EXEC.
  3015.     15) New with DOS 5.0.  Sets up for EXEC, including setting the DOS
  3016.         version number returned by SETVER/int 21h,fn 30h.  If DOS is
  3017.         installed in the HMA this function turns off the A20 line,
  3018.         making the HMA inaccessible.  If your program needs the HMA
  3019.         you must turn it back on before EXECing.  DOS normally turns
  3020.         the A20 line back on when called for normal system functions.
  3021.         Your program must call EXEC immediately after this subfunction.
  3022.         You may not call any DOS, BIOS, or system interrupts between
  3023.         this subfunction and loading your program.
  3024.     15) When in TopView this call is checked to ensure none of the
  3025.         addresses are outside the application's memory partition.
  3026.     16) This call is documented in the MS 5.0 TR, and in the PC-MOS/386
  3027.         TR.
  3028.     17) Some applications use their own EXEC scheme instead of calling 
  3029.         this function.  Since DOS 5 enhanced the EXEC functions these
  3030.         programs might not work, so Microsoft added a new set of 
  3031.         functions called EnterExecState.  If a self-EXECing program
  3032.         calls EnterExecState before EXECing, DOS 5 will do various
  3033.         internal fixups to keep things happy.
  3034.  
  3035.  
  3036. Function  4Ch   Terminate a Process                          (EXIT)
  3037.                 Quit with ERRORLEVEL exit code
  3038. entry   AH      4Ch
  3039.         AL      exit code in AL when called, if any, is passed to next
  3040.                 process
  3041. return  none
  3042. note 1) Control passes to DOS or calling program.
  3043.      2) Return code from AL can be retrieved by ERRORLEVEL or function
  3044.         4Dh.
  3045.      3) All files opened by this process are closed, buffers are
  3046.         flushed, memory is released, any network file region locks are
  3047.         released, and the disk directory is updated.
  3048.      4) Restores: Terminate vector from PSP:000Ah
  3049.                   Ctrl-C vector from PSP:000Eh
  3050.                   Critical Error vector from PSP:0012h
  3051.      5) This call is explicitly supported in the OS/2 1.x DOS
  3052.         Compatibility Box.
  3053.      6) TOS: $4C TERM. Returns 2-byte errorlevel to calling program
  3054.      7) Under DOS 3.1+ networks, all file locks should be removed
  3055.         before terminating the program.
  3056.  
  3057.  
  3058. Function  4Dh   Get Return Code of a Subprocess              (WAIT)
  3059.                 Get return from functions 31h and 4Dh  (ERRORLEVEL)
  3060. entry   AH      4Dh
  3061. return  AH      circumstance which caused termination
  3062.                 00h     normal termination
  3063.                 01h     control-break or control-C
  3064.                 02h     critical device error
  3065.                 03h     terminate and stay resident (function 31h)
  3066.         AL      exit code of subprogram (functions 31h or 4Ch)
  3067. note 1) The exit code is only returned once (the first time).
  3068.      2) This call is explicitly supported in the OS/2 1.x DOS
  3069.         Compatibility Box.
  3070.      3) Many programmers have wondered where DOS stores this
  3071.         information, so they might access it multiple times or set it
  3072.         directly.  This is a version-dependent area that changes with
  3073.         every release of DOS.
  3074.  
  3075.  
  3076. Function  4Eh   Find First Matching File                  (FIND FIRST)
  3077. entry   AH      4Eh
  3078.         CX      search attributes  (see function 43h)
  3079.         DS:DX   segment/offset pointer to ASCIIZ filename
  3080.                 (with attributes)
  3081. return  CF      set     AX      error code (02h, 03h, 12h)
  3082.                 clear   data block written at current DTA
  3083.                         format of block is:  (info from BIX)
  3084.   documented by Micro-  |00h     1 byte   attribute byte of search
  3085.   soft as "reserved for |01h     1 byte   drive letter for search
  3086.   DOS' use on subsquent |02h    11 bytes  the search name used
  3087.   Find Next calls"      |0Ch     2 bytes  word value of last entry
  3088.   function 4Fh          |0Fh     4 bytes  dword pointer to this DTA
  3089.                         |13h     2 bytes  word directory start
  3090.  
  3091.                         | PC-DOS 3.10 (from INTERRUP.ARC)
  3092.                         |00h     1 byte   drive letter
  3093.                         |01h-0Bh 11 bytes search template
  3094.                         |0Ch     1 byte   search attributes
  3095.  
  3096.                         | DOS 2.x (and DOS 3.x except 3.1?)
  3097.                                   (from INTERRUP.ARC)
  3098.                         |00h     1 byte   search attributes
  3099.                         |01h     1 byte   drive letter
  3100.                         |02h-0Ch 11 bytes search template
  3101.                         |0Dh-0Eh 2 bytes  entry count within directory
  3102.                         |0Fh-12h 4 bytes  reserved
  3103.                         |13h-14h 2 bytes  cluster number of parent
  3104.                                           directory
  3105.  
  3106.                          15h   1 byte   file attribute
  3107.                          16h   2 bytes  file time, bit mask:
  3108.                                         0-4     half-seconds
  3109.                                         5-10    minute
  3110.                                         11-15   hour
  3111.                          18h   2 bytes  file date, bit mask:
  3112.                                         0-4     day
  3113.                                         5-8     month
  3114.                                         9-15    years since 1980
  3115.                          1Ah   2 bytes  low word of file size
  3116.                          1Ch   2 bytes  high word of file size
  3117.                          1Eh  13 bytes  name and extension of file 
  3118.                                         found, plus 1 byte of 0s.  All
  3119.                                         blanks are removed from the name
  3120.                                         and extension, and if an
  3121.                                         extension is present it is
  3122.                                         preceded by a period.
  3123. note 1) This function does not support network operations.
  3124.      2) Wildcards are allowed in the filespec.
  3125.      3) If the attribute is zero, only ordinary files are found. If the
  3126.         volume label bit is set, only volume labels will be found.  Any
  3127.         other attribute will return that attribute and all normal files
  3128.         together.
  3129.      4) To look for everything except the volume label, set the hidden,
  3130.         system, and subdirectory bits all to 1.
  3131.      5) This call is explicitly supported in the OS/2 1.x DOS
  3132.         Compatibility Box.
  3133.      6) TOS: $4E SFIRST.
  3134.      7) There is a reported anomaly in MS-DOS 2.11.  Odd things happen
  3135.         when you give it "C:\" as a file name.  FindFirst reports it as
  3136.         a valid file and Open returns a handle.  If you read it twice
  3137.         DOS reports an FAT error and aborts.  You can demonstrate this
  3138.         by:
  3139.                 FIND "whatever" c:\    [twice]
  3140.         Int 21h/AH=044 AL=0 returns the handle as a NUL device which
  3141.         makes a certain amount of sense since C:\ is a null terminated
  3142.         string.  The programming solution is to trap 'C:\' before it's
  3143.         used.
  3144.      8) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX. ES:EBX
  3145.         is a pointer to a 43-byte data area used instead of the DTA.
  3146.         Format:
  3147.                 0-20    reserved for MOS
  3148.                 21      attribute
  3149.                 22-23   time of last update
  3150.                 24-25   date of last update
  3151.                 26-29   file size in bytes
  3152.                 30-42   found filename, followed by 00h
  3153.  
  3154.  
  3155. Function  4Fh   Find Next Matching File                   (FIND NEXT)
  3156.                 Find next ASCIIZ file
  3157. entry   AH      4Fh
  3158. return  CF      clear   data block written at current DTA
  3159.                 set     AX      error code (02h, 12h)
  3160. note 1) If file found, DTA is formatted as in call 4Eh.
  3161.      2) Volume label searches using 4Eh/4Fh reportedly aren't 100%
  3162.         reliable under DOS 2.x.  The calls sometime report there's a
  3163.         volume label and point to a garbage DTA, and if the volume
  3164.         label is the only item they sometimes won't find it.  Most
  3165.         references recommend the use of the older FCB calls for dealing
  3166.         with the volume labels.
  3167.      3) This function does not support network operations.
  3168.      4) Use of this call assumes that the original filespec contained
  3169.         wildcards.
  3170.      5) This call is explicitly supported in the OS/2 1.x DOS
  3171.         Compatibility Box.
  3172.      6) TOS: $4F SNEXT.
  3173.      7) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX. ES:EBX
  3174.         is a pointer to a 43-byte data area used instead of the DTA.
  3175.         Format:
  3176.                 0-20    reserved for MOS
  3177.                 21      attribute
  3178.                 22-23   time of last update
  3179.                 24-25   date of last update
  3180.                 26-29   file size in bytes
  3181.                 30-42   found filename, followed by 00h
  3182.  
  3183.  
  3184. Function  50h   "Used Internally by DOS" - Set PSP or SetPID
  3185.  *              Set new Program Segment Prefix (current Process ID)
  3186. entry   AH      50h
  3187.         BX      segment address of new PSP
  3188. return  none - swaps PSPs regarded as current by DOS
  3189. note 1) By putting the PSP segment value into BX and issuing call 50h
  3190.         DOS stores that value into a variable and uses that value
  3191.         whenever a file call is made.
  3192.      2) Note that in the PSP (or PDB) is a table of 20 (decimal) open
  3193.         file handles.  The table starts at offset 18h into the PSP.  If
  3194.         there is an 0FFh in a byte then that handle is not in use.  A
  3195.         number in one of the bytes is an index into an internal FB
  3196.         table for that handle.  For instance the byte at offset 18h is
  3197.         for handle 0, at offset 19h handle 1, etc. up to 13h.  If the
  3198.         high bit is set then the file associated by the handle is not
  3199.         shared by child processes EXEC'd with call 4Bh.
  3200.      3) Function 50h is dangerous in background operations prior to DOS
  3201.         3.x as it uses the wrong stack for saving registers.  (same as
  3202.         functions 0..0Ch in DOS 2.x).  It doesn't use stack in 3.0+, 
  3203.         so it is safe to use in later versions of DOS.
  3204.      4) Under DOS 2.x, this function cannot be invoked inside an int
  3205.         28h handler without setting the Critical Error flag.
  3206.      5) Open file information, etc. is stored in the PSP DOS views as
  3207.         current.  If a program (eg. a resident program) creates a need
  3208.         for a second PSP, then the second PSP should be set as current
  3209.         to make sure DOS closes that as opposed to the first when the
  3210.         second application finishes.
  3211.      6) See PC Mag Vol.5, No 9, p.314 for discussion, also used in
  3212.         their BCOPY.ASM utility.
  3213.      7) Used by DOS 3.3 PRINT & DEBUG, DesQview 2.01, Windows 1.03,
  3214.         SYMDEB from MASM 4.0.
  3215.      8) This call is available in the OS/2 1.x DOS Compatibility Box.
  3216.      9) DOS stores the PID in one location, but the actual address is
  3217.         version dependent.  The strategy is to find the PID and thereby
  3218.         find its address.  If you have its address, you can swap PIDs
  3219.         from the TSR pop-up code by peeking and poking.  In the
  3220.         initialization code, use function  51hto get the PID.  You
  3221.         know that DOS lives between the interrupt vectors 0:0 - 0:100
  3222.         and that PID.  Other programs might be in there, but DOS is
  3223.         too.  Search that memory for a copy of the PID.  When you find
  3224.         one, use this function to set a phony PID.  If the location
  3225.         where you found the original PID changes to the phony PID,
  3226.         you have found the address of the PID.  Don't forget to reset
  3227.         the PID with SetPID after each test.  DOS 2.0 and 2.1 maintain
  3228.         the PID in two locations, not one.
  3229.  
  3230.  
  3231. Function  51h   Get Program Segment Prefix   (GetPID)
  3232.                 Returns the PSP address of currently executing program
  3233. entry   AH      51h
  3234. return  BX      address of currently executing program (process ID)
  3235. note    format of PSP:
  3236.                 offset  size           description
  3237.                 00h   2 bytes   program exit point
  3238.                 02h     word    memory size in paragraphs
  3239.                 04h     byte    unused (0)
  3240.                 05h   5 bytes   CP/M style entry point (far call to DOS)
  3241.                 0Ah     word    terminate address (old int 22h)
  3242.                 0Ch     word    terminate segment
  3243.                 0Eh     word    break address (old int 23h)
  3244.                 10h     word    break segment
  3245.                 12h     word    error address (old int 24h)
  3246.                 14h     word    error segment
  3247.                 16h     word    parent PSP segment
  3248.                 18h  20 bytes   DOS 2.0+ open files, 0FFh = unused
  3249.                 2Ch     word    DOS 2.0+ environment segment
  3250.                 2Eh    dword    far pointer to process's SS:SP
  3251.                 32h     word    DOS 3.x+ max open files
  3252.                 34h             DOS 3.x+ open file table address
  3253.                 36h    dword    DOS 3.x+ open file table segment
  3254.                 38h 24 bytes    unused by DOS versions before 3.3
  3255.                 50h  3 bytes    DOS function dispatcher (FAR routine)
  3256.                 53h  9 bytes    unused
  3257.                 55h             FCB #1 extension
  3258.                 5Ch 16 bytes    FCB #1, filled in from first command
  3259.                                 line argument
  3260.                 6Ch 20 bytes    FCB #2, filled in from second command
  3261.                                 line argument
  3262.                 80h128 bytes    command tail / default DTA buffer
  3263. note 1) Used in DOS 2.x, 3.x uses 62h.
  3264.      2) Function 51h is dangerous in background operations prior to DOS
  3265.         3.x as it uses the wrong stack for saving registers.  (same as
  3266.         functions 0..0Ch in DOS 2.x).  Doesn't use any DOS stacks in
  3267.         DOS 3.0+.
  3268.      3) 50h and 51h might be used if you have more than one process in
  3269.         a PC.  For instance if you have a resident program that needs
  3270.         to open a file you could first call 50h to get the current ID
  3271.         and then call 50h to set the ID to your PSP.
  3272.      4) Under DOS 2.x, this function cannot be invoked inside an int
  3273.         28h handler without setting the Critical Error flag.
  3274.      5) Formerly "undocumented", now described in MS 5.0 TR.
  3275.      6) This call is available in the OS/2 1.x DOS Compatibility Box.
  3276.  
  3277.  
  3278. FUNCTION 52h - see file 52h
  3279.         provided with full version of DOSREF
  3280.  
  3281.  
  3282. Function  53h   "Used Internally by DOS" - Translate BPB
  3283.  *              Translates BPB (BIOS Parameter Block, see below) into
  3284.                 a DOS Disk Block (see function call 32h).
  3285. entry   AH      53h
  3286.         DS:SI   pointer to BPB (BIOS Parameter Block)
  3287.         ES:BP   pointer to buffer area for DOS Disk Block
  3288.                 Layout of BPB:
  3289.                 offset  size         description
  3290.                 00h-01h word  bytes per sector, get from DDB bytes
  3291.                               02h-03h.
  3292.                 02h     byte  sectors per cluster, get from (DDB byte
  3293.                               4) + 1
  3294.                 03h-04h word  reserved sectors, get from DDB bytes
  3295.                               06h-07h
  3296.                 05h     byte  number of FATs, get from DDB byte 08h
  3297.                 06h-07h word  # of root dir entries, get from DDB bytes
  3298.                               09h-0Ah
  3299.    for DOS 3.x: 08h-09h word  total number of sectors, get from:
  3300.                               ((DDB bytes 0Dh-0Eh) - 1) * (sectors per
  3301.                               cluster (BPB byte 2)) + (DDB bytes 0Bh-0Ch)
  3302.    for DOS 4.x:               set to zero if partition is larger than
  3303.                               32Mb, set dword at 15h to actual number
  3304.                               of sectors
  3305.                 0Ah     word  media descriptor byte, get from DDB byte
  3306.                               16h
  3307.                 0Bh-0Ch word  number of sectors per FAT, get from DDB
  3308.                               byte 0Fh
  3309.    for DOS 3.x: 0Dh     word  number of sectors per track
  3310.                 0Fh     word  number of heads
  3311.                 11h    dword  number of hidden sectors
  3312.                 15h 11 bytes  reserved
  3313.    for DOS 4.x: 15h    dword  total number of sectors if word at 08h
  3314.                               contains zero
  3315. return  unknown
  3316. note    This function is documented as 'SetDPB' in the Zenith MS-DOS
  3317.         3.05 TRM.
  3318.  
  3319.  
  3320. Function  54h   Get Verify Setting
  3321.                 Get verify flag status
  3322. entry   AH      54h
  3323. return  AL      00h if flag off
  3324.                 01h if flag on
  3325. note 1) Flag can be set with function 2Eh.
  3326.      2) This call is explicitly supported in the OS/2 1.x DOS
  3327.         Compatibility Box.
  3328.      3) The verify state is off by default.
  3329.  
  3330.  
  3331. Function  55h   "Used Internally by DOS" - Create "Child" PSP
  3332.  *              Create PSP: similar to function 26h (which creates a
  3333.                 new Program Segment Prefix at segment in DX) except
  3334.                 creates a "child" PSP rather than copying the existing
  3335.                 one.
  3336. entry   AH      55h
  3337.         DX      segment number at which to create new PSP.
  3338. return  unknown
  3339. note 1) This call is similar to call 26h which creates a PSP except that
  3340.         unlike call 26h the segment address of the parent process is
  3341.         obtained from the current process ID rather than from the CS
  3342.         value on the stack (from the INT 21h call).  DX has the new PSP
  3343.         value and SI contains the value to be placed into PSP:2 (top of
  3344.         memory).
  3345.      2) Function 55 is merely a substitute for function 26h.  It will
  3346.         copy the current PSP to the segment address DX with the
  3347.         addition that SI is assumed to hold the new memory top segment.
  3348.         This means that function 26h sets SI to the segment found in the
  3349.         current PSP and then calls function 55h.
  3350.  
  3351.  
  3352. Function  56h   Rename a File
  3353. entry   AH      56h
  3354.         DS:DX   pointer to ASCIIZ old pathname
  3355.         ES:DI   pointer to ASCIIZ new pathname
  3356. return  CF      clear   successful rename
  3357.                 set     AX      error code (02h, 03h, 05h, 11h)
  3358. note 1) Works with files in same logical drive only.
  3359.      2) Wildcard characters not allowed in filename.
  3360.      3) The name of a file is its full pathname.  The file's full
  3361.         pathname can be changed while leaving the actual FILENAME.EXT
  3362.         unchanged.  Changing the pathname allows the file to be
  3363.         "moved" from subdirectory to subdirectory on a logical drive
  3364.         without actually copying the file.
  3365.      4) DOS 3.x allows renaming of directories.
  3366.      5) This call is explicitly supported in the OS/2 1.x DOS
  3367.         Compatibility Box.
  3368.      6) TOS: $56 RENAME. Similar to MS-DOS 2.x.
  3369.      7) Under DOS 3.1+ networks, the user must have Read and Create
  3370.         access to the affected directories.
  3371.      8) For PC-MOS/386 native mode, use DS:EDX and ES:EDI instead of
  3372.         DS:DX and ES:DI.
  3373.  
  3374.  
  3375. Function  57h  Get/Set a File's Date and Time
  3376.                Read or modify time and date stamp on a file's directory
  3377.                entry
  3378. entry   AH      57h
  3379.         AL      function code
  3380.                 00h     Get Date and Time
  3381.                 01h     Set Date and Time
  3382.                         CX      time to be set
  3383.                         DX      date to be set
  3384.                 02h     unknown (DOS 4.0+)
  3385.                 03h     unknown
  3386.                 04h     unknown (DOS 4.0+)
  3387.         BX      file handle
  3388. return  CF      clear   CX      time of last write (if AL = 0)
  3389.                         DX      date of last write (if AL = 0)
  3390.                 set     AX      error code (01h, 06h)
  3391. note 1) Date/time formats are:
  3392.         CX bits 0Bh-0Fh hours (0-23)
  3393.                 05h-0Ah minutes (0-59)
  3394.                 00h-04h #2 sec. incr. (0-29)
  3395.         DX bits 09h-0Fh year (relative to 1980)
  3396.                 05h-08h month (0-12)
  3397.                 00h-04h day of the month (0-31)
  3398.      2) This call is explicitly supported in the OS/2 1.x DOS
  3399.         Compatibility Box.
  3400.      3) TOS: $57 GSDTOF.
  3401.  
  3402.  
  3403. Function  58h   Get/Set Allocation Strategy   (DOS 3.0+)
  3404. entry   AH      58h
  3405.         AL      00h     Get Current Strategy (see 01h)
  3406.                         Used to obtain the current allocation strategy.  
  3407.                         First Fit is the normal default.
  3408.  
  3409.                 01h     Set New Current Strategy
  3410.                         BL      new strategy
  3411.                         00h     First Fit - chooses the lowest block in
  3412.                                 memory which will fit (this is the
  3413.                                 default). (use first memory block large
  3414.                                 enough)
  3415.                         01h     Best Fit - chooses the smallest block
  3416.                                 which will fill the request.
  3417.                         02h     Last Fit - chooses the highest block
  3418.                                 which will fit.
  3419.         (DOS 5.0)       40h     FIRST_FIT_HIGHONLY - search upper memory
  3420.                                 area for the lowest available block
  3421.         (DOS 5.0)       41h     BEST_FIT_HIGHONLY -  search upper memory
  3422.                                 area for the smallest block that fits
  3423.                                 the request
  3424.         (DOS 5.0)       42h     LAST_FIT_HIGHONLY -  search upper memory
  3425.                                 area for the highest available block
  3426.         (DOS 5.0)       80h     FIRST_FIT_HIGH - search upper memory
  3427.                                 area for the lowest available block.  If
  3428.                                 no block found, load in conventional
  3429.                                 memory
  3430.         (DOS 5.0)       81h     BEST_FIT_HIGH - seach the upper memory
  3431.                                 area for the closest match to the
  3432.                                 requested size.  If no match is found,
  3433.                                 load in convenional memory.
  3434.         (DOS 5.0)       82h     LAST_FIT_HIGH - search the upper memory
  3435.                                 area for the available block at the
  3436.                                 highest address.  If no block is found,
  3437.                                 load in conventional memory.
  3438.                 02h     Get UMB Link State
  3439.                         Indicates if high DOS memory arenas are
  3440.                         currently part  of the conventional DOS memory
  3441.                         arena.
  3442.                 03h     Set UMB Link State
  3443.                         BX      00h     Unlink High DOS memory blocks
  3444.                                 01h     Link High DOS memory blocks
  3445.                         note:   Adds or removes high memory blocks from
  3446.                                 the DOS arena.  Returns an error if no
  3447.                                 high arenas exist.
  3448. return  CF      clear   successful
  3449.           (AL=00)       AX      strategy code (see 01h)  For DOS 5.0+,
  3450.           (AL=02)       AL      00h   if upper memory area is not linked
  3451.                                 01h   if the upper memory area is linked
  3452.                 set     error
  3453.                         AX      error code (01h)
  3454.           (AL=03)       AX      0001h   invalid function if DOS was 
  3455.                                         loaded without DOS=UMB
  3456.                                 0007h   memory arena trashed
  3457. note 1) A program that changes the allocation strategy or the high DOS
  3458.         link state should ALWAYS restore it to its original condition
  3459.         before exiting, or subsequent programs may fail.
  3460.      2) The set subfunction accepts any value in BL; 2 or greater means
  3461.         last fit.  The get subfunction returns the last value set, so
  3462.         programs should check whether the value is greater than or equal
  3463.         to 2.
  3464.      3) For discussion of best fit vs. first fit allocation strategies,
  3465.         see Knuth, *Fundamental Algorithms.*  Very briefly, Knuth finds
  3466.         that first fit methods are far superior to best fit, which
  3467.         increases both allocation overhead and memory fragmentation.
  3468.         The "last" fit that DOS offers is nothing other than a first
  3469.         fit, starting the search at the other end of the chain (the
  3470.         algorithm still takes the first fitting block that is
  3471.         encountered in the search).
  3472.      4) For DOS 5+, the default scheme is "allocate high first".  This 
  3473.         is actually a variant of the previous first/best/last 
  3474.         allocation options.  When enabled, the high-first strategy
  3475.         causes DOS to begin its free block search at the first UMB. If
  3476.         DOS can't find enough memory in the UMB, it searches from the
  3477.         beginning of conventional memory.  As a result, high-first may
  3478.         result in a worse fit than best fit alone if there is a better
  3479.         fit low than high.
  3480.  
  3481.  
  3482. Function  59h   Get Extended Error Code (DOS 3.0+)
  3483.        The Get Extended Error function call (59h) is intended to provide
  3484.      a common set of error codes and to supply more extensive
  3485.      information about the error to the application.  The information
  3486.      returned from function call 59h, in addition to the error code,
  3487.      is the error class, the locus, and the recommended action.  The
  3488.      error class provides information about the error type (hardware,
  3489.      internal, system, etc.).  The locus provides information about
  3490.      the area involved in the failure (serial device, block device,
  3491.      network, or memory).  The recommended action provides a default
  3492.      action for programs that do not understand the specific error code.
  3493.  
  3494.        Newly written programs should use the extended error support
  3495.      both from interrupt 24h hard error handlers and after any int
  3496.      21h function calls.  FCB function calls report an error by
  3497.      returning 0FFh in AL.  Handle function calls report an error by
  3498.      setting the carry flag and returning the error code in AX.  Int
  3499.      21h handle function calls for DOS 2.x continue to return error
  3500.      codes 0-18.  Int 24h handle function calls continue to return
  3501.      error codes 0-12.  But the application can obtain any of the
  3502.      error codes used in the extended error codes table by issuing
  3503.      function call 59h.  Handle function calls for DOS 3.x can return
  3504.      any of the error codes.  However, it is recommended that the
  3505.      function call be followed by function call 59h to obtain the
  3506.      error class, the locus, and the recommended action.
  3507.  
  3508.        The Get Extended Error function (59h) can always be called,
  3509.      regardless of whether the previous DOS call was old style (error
  3510.      code in AL) or new style (carry bit).  It can also be used inside
  3511.      an int 24h handler.
  3512.  
  3513.        You can either check AL or the carry bit to see if there was no
  3514.      error, and call function 59h only if there was an error, or take
  3515.      the simple approach of always calling 59h and letting it tell you
  3516.      if there was an error or not.  When you call function 59h it will
  3517.      return with AX=0 if the previous DOS call was successful.
  3518.  
  3519.        Various versions of IBM's DOS, MSDOS, OEM customized versions
  3520.      of MSDOS, Digital's DRDOS, and other DOS emulating environments
  3521.      sometimes return different error codes for the same function.
  3522.      Be careful if you are testing for one specific error condition.
  3523.  
  3524. entry   AH      59h
  3525.         BX      version code (0000 for DOS 3.0 and 3.1)
  3526. return  AX      extended error code:
  3527.                 01h     Invalid function number                     2.0+    
  3528.                 02h     File not found                              2.0+    
  3529.                 03h     Path not found                              2.0+    
  3530.                 04h     Too many open files, no file handles left   2.0+    
  3531.                 05h     Access denied                               2.0+    
  3532.                 06h     Invalid handle                              2.0+    
  3533.                 07h     Memory control blocks destroyed             2.0+    
  3534.                 08h     Insufficient memory                         2.0+    
  3535.                 09h     Invalid memory block address                2.0+    
  3536.                 0Ah     Invalid environment                         2.0+    
  3537.                 0Bh     Invalid format                              2.0+    
  3538.                 0Ch     Invalid access code                         2.0+    
  3539.                 0Dh     Invalid data                                2.0+    
  3540.                 0Eh     Reserved                                    2.0+    
  3541.                 0Fh     Invalid drive was specified                 2.0+    
  3542.                 10h     Attempt to remove the current directory     2.0+    
  3543.                 11h     Not same device                             2.0+    
  3544.                 12h     No more files                               2.0+    
  3545.                 13h     Tried to access write-protected diskette    2.0+    
  3546.                 14h     Unknown unit                                2.0+    
  3547.                 15h     Drive not ready                             2.0+    
  3548.                 16h     Unknown command                             2.0+    
  3549.                 17h     Bad CRC check                               2.0+    
  3550.                 18h     Bad request structure length                2.0+    
  3551.                 19h     Seek error                                  2.0+    
  3552.                 1Ah     Unknown media type                          2.0+    
  3553.                 1Bh     Sector not found                            2.0+    
  3554.                 1Ch     Printer out of paper                        2.0+    
  3555.                 1Dh     Write fault                                 2.0+    
  3556.                 1Eh     Read fault                                  2.0+    
  3557.                 1Fh     General failure                             2.0+    
  3558.                 20h     Sharing violation                           3.0+    
  3559.                 21h     Lock violation                              3.0+    
  3560.                 22h     Invalid disk change                         3.0+    
  3561.                 23h     FCB unavailable                             3.0+    
  3562.                 24h     Sharing buffer overflow                     3.3+    
  3563.                 25h     Bad code page                               4.0+    
  3564.                 26h     Handle EOF                                  4.0+    
  3565.                 27h     Handle disk full                            4.0+    
  3566.                 28h     Reserved
  3567.                 29h        "
  3568.                 2Ah        "
  3569.                 2Bh        "
  3570.                 2Ch        "
  3571.                 2Dh        "
  3572.                 2Eh        "
  3573.                 2Fh        "
  3574.                 30h        "
  3575.                 31h     Reserved
  3576.                 32h     Network: request not supported              3.1+    
  3577.                 33h     Network: remote computer not listening      3.1+    
  3578.                 34h     Network: duplicate name on network          3.3+    
  3579.                 35h     Network: name not found                     3.3+    
  3580.                 36h     Network: busy                               3.3+    
  3581.                 37h     Network: device no longer exists            3.3+    
  3582.                 38h     Network: NETBIOS command limit exceeded     3.3+    
  3583.                 39h     Network: adapter hardware error             3.3+    
  3584.                 3Ah     Network: incorrect response from network    3.3+    
  3585.                 3Bh     Network: unexpected network error           3.3+    
  3586.                 3Ch     Network: incompatible remote adapter        3.3+    
  3587.                 3Dh     Network: print queue full                   3.3+    
  3588.                 3Eh     Network: not enough space for print file    3.3+    
  3589.                 3Fh     Network: print file was deleted             3.3+    
  3590.                 40h     Network: name was deleted                   3.3+    
  3591.                 41h     Network: access denied                      3.3+    
  3592.                 42h     Network: device type incorrect              3.3+    
  3593.                 43h     Network: name not found                     3.3+    
  3594.                 44h     Network: name limit exceeded                3.3+    
  3595.                 45h     Network: NETBIOS session limit exceeded     3.3+    
  3596.                 46h     Network: sharing temporarily paused         3.3+    
  3597.                 47h     Network: request not accepted               3.3+    
  3598.                 48h     Network: print or disk redirection paused   3.1+    
  3599.                 49h     Reserved
  3600.                 4Ah        "
  3601.                 4Bh        "
  3602.                 4Ch        "
  3603.                 4Dh        "
  3604.                 4Eh        "
  3605.                 4Fh     Reserved
  3606.                 50h     File exists                                 3.3+    
  3607.                 51h     Reserved                                    3.3+    
  3608.                 52h     Cannot make directory entry                 4.0+    
  3609.                 53h     Fail on interrupt 24h                       3.3+    
  3610.                 54h     Network: too many redirections              3.3+    
  3611.                 55h     Network: duplicate redirection              3.3+    
  3612.                 56h     Invalid password                            3.3+    
  3613.                 57h     Invalid parameter                           3.3+    
  3614.                 58h     Network: data fault (write error)           3.3+    
  3615.                 59h     Reserved                                            
  3616.                 5Ah     Comp not loaded                             5.0+    
  3617.         BH      class of error:                          (DOS 5.0 name)
  3618.                 01h     Out of resource                 ERRCLASS_OUTRES
  3619.                         (not enough disk space, etc)
  3620.                 02h     Temporary situation             ERRCLASS_TEMPSIT
  3621.                         (not an error, but a temporary situation that is
  3622.                          expected to end, such as a locked region in a
  3623.                          file)
  3624.                 03h     Authorization                   ERRCLASS_AUTH
  3625.                         (denied access - sharing or network)
  3626.                 04h     Internal                        ERRCLASS_INTRN
  3627.                         (DOS internal error)
  3628.                 05h     Hardware failure                ERRCLASS_HRDFAIL
  3629.                         (bad floppy or HD controller, etc.)
  3630.                 06h     System failure                  ERRCLASS_SYSFAIL
  3631.                         (error not due to executing program, such as
  3632.                          missing configuration or data files)
  3633.                 07h     Application program error       ERRCLASS_APPERR
  3634.                         (executing program bombed)
  3635.                 08h     Not found                       ERRCLASS_NOTFND
  3636.                         (file or device not found)
  3637.                 09h     Bad format                      ERRCLASS_BADFMT
  3638.                         (file or item invalid format or type)
  3639.                 0Ah     Locked                          ERRCLASS_LOCKED
  3640.                         (network or SHARE lock)
  3641.                 0Bh     Media error                     ERRCLASS_MEDIA
  3642.                         (wrong volume ID, disk failure)
  3643.                 0Ch     Already exists                  ERRCLASS_ALREADY
  3644.                         (file or device already exists)
  3645.                 0Dh     Unknown                         ERRCLASS_UNK
  3646.                         (Smurfs infesting system board)
  3647.         BL      suggested action code:
  3648.                 01h     Retry                           ERRACT_RETRY
  3649.                 02h     Delayed retry                   ERRACT_DLYRET
  3650.                 03h     Prompt user                     ERRACT_USER
  3651.                 04h     Abort after cleanup             ERRACT_ABORT
  3652.                 05h     Immediate abort                 ERRACT_PANIC
  3653.                 06h     Ignore                          ERRACT_IGNORE
  3654.                 07h     Retry after user intervention   ERRACT_INTRET
  3655.         CH      locus (where error occurred):
  3656.                 01h     Unknown or not appropriate      ERRLOC_UNK
  3657.                 02h     Block device                    ERRLOC_DISK
  3658.                 03h     Network related                 ERRLOC_NET
  3659.                 04h     Serial device                   ERRLOC_SERDEV
  3660.                 05h     Memory related                  ERRLOC_MEM
  3661. note 1) Not all DOS functions use the carry flag to indicate an error.
  3662.         Carry should be tested only on those functions which are
  3663.         documented to use it.
  3664.      2) None of the DOS functions which existed before 2.0 use the
  3665.         carry indicator.  Many of them use register AL as an error
  3666.         indication instead, usually by putting 0FFh in AL on an error.
  3667.         Most, but not all, the "new" (2.x, 3.x) functions do use carry,
  3668.        and most, but not all, of the "old" (1.x) functions use AL.
  3669.      3) On return, CL, DI, DS, DX, ES, BP, and SI are destroyed - save
  3670.         before calling this function if required.
  3671.      4) DOS 2.x Error Codes:  If you are using function calls 38h-57h
  3672.         with DOS 2.x, to check if an error has occurred, check for the
  3673.         following error codes in the AX register:
  3674.         call| error code    call| error code     call| error code
  3675.         ----|-------------------|--------------------|----------------
  3676.         38h | 2             41h | 2,3,5          4Ah | 7,8,9
  3677.         39h | 3,5           42h | 1,6            4Bh | 1,2,3,5,8,10,11
  3678.         3Ah | 3,5,15        43h | 1,2,3,5        4Eh | 2,3,18
  3679.         3Bh | 3             44h | 1,3,5,6        4Fh | 18
  3680.         3Ch | 3,4,5         45h | 4,6            56h | 2,3,5,17
  3681.         3Dh | 2,3,4,5,12    46h | 4,6            57h | 1,6
  3682.         3Eh | 6             47h | 15
  3683.         3Fh | 5,6           48h | 7,8
  3684.         40h | 5,6           49h | 7,9
  3685.      5) Note that extended error codes 13h through 1Fh correspond to
  3686.         error codes 00h through 0Ch returned by int 24h.
  3687.      6) This call is explicitly supported in the OS/2 1.x DOS
  3688.         Compatibility Box.
  3689.  
  3690.  
  3691. Function  5Ah   Create Temporary File
  3692.                 Create unique filename (for temporary use) (DOS 3.0+)
  3693. entry   AH      5Ah
  3694.         DS:DX   pointer to buffer containing an ASCIIZ directory
  3695.                 pathname ending with a backslash (\).  The buffer must
  3696.                 have at least 13 bytes free following the backslash,
  3697.                 as the file name and extension will be written there.
  3698.         CX      file attribute (00h, 01h, 02h, 04h, 20h only)
  3699. return  CF      clear   AX      handle
  3700.                         DS:DX   new ASCIIZ pathname
  3701.                 set     AX      error code (03h, 04h, 05h)
  3702. note 1) The file created is not truly "temporary".  It must be removed
  3703.         by the user.
  3704.      2) If the filename created already exists in the current
  3705.         directory, this function will call itself again with another
  3706.         unique filename until a truly unique filename is found.
  3707.      3) The temporary filename usually consists of mixed letters and
  3708.         numbers.  No file extension appears to be generated.
  3709.      4) DOS 3.0-4.01 used mixed letters and numbers.  MS DOS 5.0 appears
  3710.         to use letters only.  DR DOS 5.0 appears to use numbers only.
  3711.      5) Under DOS 3.1+ and NETBIOS compatible networks, DOS opens the 
  3712.         file in compatibility mode.
  3713.      6) This call is explicitly supported in the OS/2 1.x DOS
  3714.         Compatibility Box.
  3715.      7) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  3716.  
  3717.  
  3718. Function  5Bh   Create a New File   (DOS 3.0+)
  3719. entry   AH      5Bh
  3720.         DS:DX   segment/offset pointer to an ASCIIZ pathname
  3721.         CX      file attribute (00h, 01h, 02h, 04h, 20h only)
  3722. return  CF      clear   AX      file handle
  3723.                         DS:DX   new ASCIIZ pathname
  3724.                 set     AX      error code (03h, 04h, 05h, 50h)
  3725. note 1) Unlike function 3Ch, function 5Bh will fail if the file already
  3726.         exists.  This is useful on networks, since another application
  3727.         might create a file of the same name with 3Ch first, causing
  3728.         the first 3Ch to fail.  Use of this call instead of 3Ch is good
  3729.         practice for code that will not need to run under DOS 2.x.
  3730.      2) Under DOS 3.1+ networks, DOS opens the file in read/write mode.
  3731.         This call will fail if the user does not have Create access.
  3732.      3) This call is explicitly supported in the OS/2 1.x DOS
  3733.         Compatibility Box.
  3734.      4) The MSDOS Encyclopedia suggests this call may be used to
  3735.         implement semaphores in LANs or multitasking environments.  A
  3736.         zero-byte marker file could be created to indicate semaphore set.
  3737.      5) For PC-MOS/386 native mode, use DS:EDX instead of DS:DX.
  3738.  
  3739.  
  3740. Function  5Ch   Lock/Unlock File Access   (DOS 3.0+)
  3741. entry   AH      5Ch
  3742.         AL      00h     to lock file region
  3743.                 01h     to unlock file region
  3744.         BX      file handle
  3745.         CX:DX   4-byte starting offset from beginning of file of region
  3746.                 to lock
  3747.         SI:DI   4-byte integer, high/low size of region to lock
  3748.                 (in bytes)
  3749. return  CF      clear   successful
  3750.                 set     AX      error code (01h, 06h, 21h, 24h)
  3751. note 1) Unlock all files before exiting or undefined results may occur.
  3752.         Programs using file locking should trap int 23h (Control-C
  3753.         Handler Address) and int 24h (Critical Error Handler Address)
  3754.         and unlock files before returning to the caller.
  3755.      2) Programs spawned with EXEC inherit all the parent's file
  3756.         handles but not the file locks.
  3757.      3) This call is explicitly supported in the OS/2 1.x DOS
  3758.         Compatibility Box.
  3759.      4) You may lock an entire file, any part of a file, or several
  3760.         parts of the same file.  For example, it would be more
  3761.         efficient to lock an area in a database containing a single
  3762.         record than to lock the entire file.  If two adjacent sections
  3763.         of a file are locked separately, they  must be unlocked
  3764.         separately - you cannot change the lock pointers and use a
  3765.         single unlock call.
  3766.      5) You should lock only as much of a file as you need and keep
  3767.         the lock only for as long as necessary.  Should a file need to
  3768.         be shared and updated often, continual locking and unlocking
  3769.         can slow file access detectably.
  3770.      6) This call returns error 01h if SHARE is not loaded.
  3771.      7) Locked files must be unlocked before the program terminates,
  3772.         or the result is undefined.
  3773.      8) A transaction-oriented algorithm for using locking is
  3774.         recommended.  In effect, assert lock, read data, change data,
  3775.         remove lock.  An application should release its lock when a
  3776.         transaction is complete.
  3777.      9) Locking past end-of-file does not cause an error.
  3778.     10) Locking a portion of a file with fn 5Ch denies all other
  3779.         processes both read and write access to the locked region.
  3780.     11) For PC-MOS/386 native mode, use ECX and EDX instead of CX:DX.
  3781.  
  3782.  
  3783. Function  5Dh   Multifunction, DOS  Internal - partial (DOS 3.x+)
  3784. entry   AH      5Dh
  3785.         AL      subfunction
  3786.                 00h     Indirect Function Call
  3787.                         DS:DX   pointer to buffer containing register
  3788.                                 values AX, BX, CX, DX, SI, DI, DS, ES
  3789.                                 for a call to int 21h
  3790.                         return  as appropriate for function being called
  3791.                         note    Does not check AH.  Out of range values
  3792.                                 will crash the system.
  3793.                 01h     SYNC?  (DOS 3.1+)
  3794.                         parameters unknown
  3795.                         note 1) Does something to each disk file in the
  3796.                                 system.  File Table which has been
  3797.                                 written to.
  3798.                              2) If remote file, calls int 2Fh/fn1107h.
  3799.                              3) Seems to update the time stamp of all
  3800.                                 open files which have been written to.
  3801.                 02h     SHARE.EXE? (DOS 3.1+)
  3802.                         note    Error unless SHARE is loaded
  3803.                                 (calls fn 52h+4Ah)
  3804.                 03h     SHARE.EXE? (DOS 3.1+)
  3805.                         note    Error unless SHARE is loaded
  3806.                                 (calls fn 52h+4Ah)
  3807.                 04h     SHARE.EXE functions? (DOS 3.1+)
  3808.                         note    Error unless SHARE is loaded
  3809.                                 (calls fn 52h+4Ah)
  3810.                 05h     Network functions? (DOS 3.1+)
  3811.                         DS:DX   pointer to buffer (see AX=0Ah), only
  3812.                                 fields at offset 12h, 14h used
  3813.                         note    Error unless SHARE is loaded
  3814.                                 (calls fn 52h+5Ah)
  3815.                 06h     Get Address of Critical Error Flag
  3816.                         DS:DX   pointer to buffer (see 0Ah), only
  3817.                                 fields at offset 12h, 14h used
  3818.                         return  CX      unknown value
  3819.                                 DX      unknown value
  3820.                                 DS:SI   pointer to critical error flag
  3821.                         notes   This call does a lot of other work in
  3822.                                 addition to returning the pointer.
  3823.                                 Setting the CritErr flag allows use of
  3824.                                 functions 50h/51h from int 28h under
  3825.                                 DOS 2.x by forcing use of correct stack.
  3826.     (LANtastic) 07h     Return Redirected Printer mode
  3827.                         return  DL      00      output is combined
  3828.                                         01h     output is separated
  3829.                         note    The current printer mode (either
  3830.                                 printer output combined or separated)
  3831.                                 is returned.
  3832.     (LANtastic) 08h     Set Redirected Printer Mode
  3833.                         DL      00h     set redirected output to be
  3834.                                         combined
  3835.                                 01h     set redirected output to be
  3836.                                         separated.  (implicitly starts
  3837.                                         a new print job)
  3838.                         return  none
  3839.                         note 1) The current printer mode (either printer
  3840.                                 output combined or separated) can be set.
  3841.                              2) may be used by COMMAND.COM
  3842.     (LANtastic) 09h     Flush Printer Output
  3843.                         return  none
  3844.                         note 1) Printer output is flushed and a new
  3845.                                 print job is started.  If no output
  3846.                                 exists to be flushed then this function
  3847.                                 has no effect.
  3848.                              2) may be used by COMMAND.COM
  3849.                 09h     unknown - may be used by COMMAND.COM
  3850. (DOS 5, doc'd)  0Ah     Set Extended Error Information
  3851.                         DS:DX   address of 11-word error information 
  3852.                                 table:
  3853.                                 format of error information table:
  3854.                                 offset  size    description
  3855.                                 00h    word    value that next call to
  3856.                                                fn 59h  will return in AX
  3857.                                 02h    word    value that next call to
  3858.                                                fn 59h will return in BX
  3859.                                 04h    word    CX
  3860.                                 06h    word    DX
  3861.                                 08h    word    SI
  3862.                                 0Ah    word    DI
  3863.                                 0Ch    word    DS
  3864.                                 0Eh    word    ES
  3865.                                 10h    word    reserved (set to 0)
  3866.                                 12h    word    user (computer) ID,
  3867.                                                0=local
  3868.                                 14h    word    program ID, 0=local
  3869.                                                program
  3870.                 return  none
  3871. return   DS:SI   (for 06h) pointer to critical error flag
  3872. note 1) Function 0Ah; DOS 3.1+.
  3873.      2) Function 06h; setting CritErr flag allows use of functions
  3874.         50h/51h from int 28h under DOS 2.x by forcing the use of the
  3875.         correct stack.
  3876.      3) Functions 07h, 08h, 09h are identical in DOS 3.1 and call int
  3877.         2Fh fn 1125h.
  3878.  
  3879.  
  3880. Function  5Eh   Network Printer
  3881.                 DOS 3.1+ with Networks software
  3882.                 PC-MOS/386 through 4.1 has limited support for functions
  3883.                 5Eh through 5F04h.  The MOS NETBIOS driver must be
  3884.                 loaded.  A device name is returned for 5E00h and an
  3885.                 "end of list" status is returned for other functions.
  3886. entry   AH      5Eh
  3887.         AL      00h     Get Machine Name
  3888.                         DS:DX   pointer to 16-byte buffer for ASCIIZ name
  3889.                         return  CH      00h     if name not defined
  3890.                                         <>0     name is defined
  3891.                                 CL      00h     name not set
  3892.                                         <>0     NetBIOS name number
  3893.                                 DS:DX   pointer to ASCIIZ name if CH <>0
  3894.                                 CF      set on error
  3895.                                         AX      error code (01h)
  3896.                         note 1) The ASCIIZ name is a 15 byte string
  3897.                                 padded to length with zeroes.
  3898.                              2) The NETBIOS number in CL and name at
  3899.                                 DS:DX are valid only if the value
  3900.                                 returned in CH is <>0.
  3901.                 01h     Set Machine Name
  3902.                         CH      00h     undefine name
  3903.                                 <>0     define name
  3904.                         CL      name number
  3905.                         DS:DX   pointer to ASCIIZ name
  3906.                 02h     Set Printer Control String
  3907.                         BX      redirection list index
  3908.                         CX      length of setup string (max 64 bytes)
  3909.                         DS:SI   pointer to ASCIIZ setup string buffer
  3910.                         return: CF      set on error
  3911.                                         AX      error code (01h)
  3912.                         note 1) Set printer setup sets a setup string
  3913.                                 to be sent to the network printer
  3914.                                 whenever a file is queued to the
  3915.                                 printer.
  3916.                              2) LANtastic LANOS does not process this
  3917.                                 request since printer setup strings are
  3918.                                 controlled by the system administrator
  3919.                                 using the NET_MGR program.  The system
  3920.                                 call does not return an error, however.
  3921.                 03h     Get Printer Control String
  3922.                         BX      redirection list index
  3923.                         ES:DI   pointer to 64-byte string buffer
  3924.                         return  CX      length of setup string
  3925.                                         (maximum 64 bytes)
  3926.                         return: CF      set on error
  3927.                                         AX      error code (01h)
  3928.                         note 1) This call will return the setup string
  3929.                                 set with fn 02h above.
  3930.                              2) LANtastic LANOS does not process this
  3931.                                 request since printer setup strings are
  3932.                                 controlled by the system administer
  3933.                                 using the NET_MGR program.  The system
  3934.                                 call does not return an error, however,
  3935.                                 and the length of the setup string (CX)
  3936.                                 is 0.
  3937.                 04h     DOS 3.1+ +Microsoft Networks - unknown
  3938.                         note    Calls int 2F/AX=111Fh with 5E04h on
  3939.                                 stack.
  3940.                 05h     DOS 3.1+ +Microsoft Networks - unknown
  3941.                         note    Calls int 2F/AX=111Fh with 5E05h on
  3942.                                 stack.
  3943.                 06h     DOS 3.1+ +Microsoft Networks - unknown
  3944.                         note    Calls int 2F/AX=111Fh with 5E06h on
  3945.                                 stack.
  3946. return  CF      clear   successful
  3947.                 set     error
  3948.                         AX      error code (01h for all listed subfns)
  3949. note 1) Used in IBM's & Microsoft's Network programs.
  3950.      2) Partial documentation in Fall 1985 Byte, in Advanced MS-DOS,
  3951.         in MS-DOS Encyclopedia, LANtastic Programmer's Manual.  
  3952.      3) These services require that the network software be installed.
  3953.      4) SHARE must be loaded or results can be unpredictable on 00h,
  3954.         or fail with 02h or 03h.
  3955.      5) The redirection entry index is an index into a table that
  3956.         identifies the printer as a device on the network.
  3957.  
  3958.  
  3959. Function  5Fh   Network Redirection
  3960.                 (DOS 3.1+ and Microsoft Networks)
  3961. entry   AH      5Fh
  3962.         AL     *00h     Unknown
  3963.                *01h     Unknown
  3964.                 02h     Get Redirection List Entry
  3965.                         BX      redirection entry index.  Index 0
  3966.                                 specifies the first entry
  3967.                         DS:SI   pointer to 16 byte area which will
  3968.                                 receive the ASCIIZ local device name
  3969.                         ES:DI   pointer to 128 byte buffer for the
  3970.                                 ASCIIZ network device name
  3971.                         return  CF      set on error
  3972.                                         AX      error code (01h, 12h)
  3973.                                 BH      device status flag
  3974.                                         (bit 0=0 if valid)
  3975.                                         (bit 0=1 if invalid)
  3976.                                         (bits 1-7 reserved)
  3977.                                 BL      device type
  3978.                                         03      printer device
  3979.                                         04      drive device (file)
  3980.                                 CX      value stored by fn 03h call.
  3981.                                         Should be 0 for compatiblity
  3982.                                         with LAN OS
  3983.                                 DS:SI   pointer to 16 byte ASCIIZ local
  3984.                                         device name
  3985.                                 ES:DI   pointer to 128 byte ASCIIZ
  3986.                                         network name
  3987.                         note 1) DX and BP are destroyed by this call.
  3988.                              2) This call returns information about a
  3989.                                 single redirected device (see fn 03h).
  3990.                                 This fn may be used to scan the list of
  3991.                                 redirected devices.
  3992.                 03h     Redirect Device - Make Assign List Entry
  3993.                         Redirects a workstation drive or device to a
  3994.                         server directory or device.
  3995.                         AX      error code if error
  3996.                         BL      device type
  3997.                                 03h     printer device
  3998.                                 04h     file device
  3999.                         CX      stored parameter value (0 for
  4000.                                 compatibility with IBM PC Network
  4001.                                 program and LANtastic)
  4002.                         DS:SI   pointer to 16-byte ASCIIZ source
  4003.                                 device name for printer: PRN, LPT1,
  4004.                                 LPT2, LPT3
  4005.                         ES:DI   pointer to destination 128-byte
  4006.                                 ASCIIZ network path and ASCIIZ
  4007.                                 password  (e.g.,'\\machine_name\path',
  4008.                                 0,'password',0)
  4009.                         return  CF      set on error
  4010.                                         AX      error code (01h, 03h,
  4011.                                                 05h, 08h, 0Fh, 12h)
  4012.                         note 1) Redirect device allows you to connect
  4013.                                 local devices to network paths.  For
  4014.                                 example you can connect your LPT1 to
  4015.                                 a printer on another node.  References
  4016.                                 to LPT1 are routed to the network.
  4017.                              2) If the password is omitted, the
  4018.                                 pathname must be followed by two null
  4019.                                 bytes.
  4020.                              3) For printer redirection, MS-Network
  4021.                                 intercepts int 17h.  When redirection
  4022.                                 is canceled, all printing is sent to
  4023.                                 the first local printer. (LPT1)
  4024.                 04h     Cancel Redirection Assignment
  4025.                         DS:SI   pointer to ASCIIZ device name or
  4026.                                 network path to be canceled
  4027.                         return  CF      set on error
  4028.                                         AX      error code (01h, 03h,
  4029.                                                 05h, 08h, 0Fh, 12h)
  4030.                         note 1) Cancel device redirection allows you
  4031.                                 to remove a device redirection so that
  4032.                                 the device is restored to its former
  4033.                                 state.
  4034. return  CF      clear   successful
  4035.                 set     if error
  4036.                         AX      error code
  4037.                                 (fn 02h) 01h, 12h
  4038.                                 (fn 03h) 01h, 03h, 05h, 08h
  4039.                                 (fn 04h) 01h, 0Fh
  4040. note 1) Used in IBM's Network program and Microsoft MS-Networks.
  4041.      2) Partial documentation in Fall 1985 Byte, in Advanced MS-DOS,
  4042.         in the MS-DOS Encyclopedia, LANtastic Programmer's Manual.  
  4043.      3) These services require that the network software be installed.
  4044.      4) SHARE must be loaded or the call will fail.
  4045.      5) The network device name requires a password.
  4046.      6) Only printer and disk devices are supported for redirection.
  4047.         STDAUX, STDIN, STDOUT, and STERR are not supported by the
  4048.         Microsoft/IBM specification.   Other companies have managed
  4049.         to do this with various nonstandard additions to the API.
  4050.  
  4051.  
  4052. Function  60h   Parse pathname  (TRUENAME)     (DOS 3.0+)
  4053.  *              Perform name processing on a string (internal to DOS)
  4054. entry   AH      60h
  4055.         DS:SI   pointer to ASCIIZ source string (null terminated)
  4056.         ES:DI   pointer to destination 80 byte ASCIIZ string buffer
  4057. return  ES:DI   buffer filled with qualified name in form (drive):(path)
  4058.         CF      set     error
  4059.                         AX      error code (02h, 03h)
  4060.                 clear   no error
  4061. note 1) Documented in Zenith 3.05 Technical Reference.
  4062.      2) All name processing is performed on the input string; string
  4063.         substitution is performed on the components, current drive/
  4064.         directories are prepended, .  and ..  are removed.  Under most
  4065.         networking software, the drive letter is replaced with the node
  4066.         name, i.e. returns pathname like \\SERVER\UTILS\TEST.TXT
  4067.         instead of F:\UTILS\TEST.TXT.
  4068.      3) Example: If current drive/directory is C:\TEST,  MYFILE.X is
  4069.         translated to C:\TEST\MYFILE.X; ..\SOURCE\SAMPLE.ASM is 
  4070.         translated to C:\SOURCE\SAMPLE.ASM.
  4071.      4) It is the caller's responsibility to make sure DS:SI does not
  4072.         point to a null string.  If it does, SI is incremented, a null
  4073.         byte is stored at ES:DI, and the routine returns.
  4074.      5) Used by CHKDSK, at least in DOS 3.3, and DOS 3.x.
  4075.      6) If path string is on a JOINed drive, the returned name is the
  4076.         one that would be needed if the drive were not JOINed;
  4077.         similarly for a SUBSTed drive letter.  Because of this, it is
  4078.         possible to get a qualified name that is not legal with the
  4079.         current combination of SUBSTs and JOINs.
  4080.      7) Used by DOS 4.0 SHELLC.EXE.
  4081.      8) This call has been discovered in DOS versions as early as
  4082.         2.11.
  4083.      9) In Novell Netware 2.1x, this call is not supported when the
  4084.         8th bit (high ASCII) is set on any letter in the file or
  4085.         pathname, and when the file being inquired about is on a
  4086.         remote drive.  This causes problems with machines using
  4087.         foreign code pages.
  4088.     10) You need DPMI services to use this call under MS Windows 3.x.
  4089.         There is an example in PC Magazine, 25 June 1991, p. 389
  4090.         called TRUENAME.C.
  4091.  
  4092.  
  4093. Function  61h   undocumented - (DOS 3.0)
  4094.  *              Internal to DOS - parameters not known
  4095. entry   AH      61h
  4096. return  AL      00h
  4097. note    Supposedly documented in Zenith DOS 3.05 Technical Reference.
  4098.  
  4099.  
  4100. Function  62h   Get Program Segment Prefix (PSP) (DOS 3.0+)
  4101. entry   AH      62h
  4102. return  BX      segment address of PSP
  4103. note    Under DOS 3.x+, this function does not use any of DOS' internal
  4104.         stacks and is thus fully reentrant.
  4105.  
  4106.  
  4107. Function  63h   Get Lead Byte Table  (MS-DOS 2.25 only)
  4108.                 Added in DOS 2.25 for additional foreign character
  4109.                 set support.
  4110. entry   AH      63h
  4111.         AL      subfunction
  4112.                 00h     get system lead byte table address
  4113.                 01h     set/clear interim console flag
  4114.                         DL      0000h   to clear interim console flag
  4115.                                 0001h   to set interim console flag
  4116.                 02h     get interim console flag
  4117. return  DS:SI   pointer to lead byte table (AL = 00h)
  4118.         DL      interim console flag (AL = 02h)
  4119. note 1) Function 63h destroys all registers except SS:SP on return.
  4120.         To avoid saving registers repeatedly, a process can copy the
  4121.         table or save the pointer for later use.
  4122.      2) Works ONLY in MS-DOS 2.25!
  4123.      3) Note fn 63h does not return errors in AL or CF.
  4124.      4) Original support was for Kanji (Japanese) and Hanegul (Korean)
  4125.         only.
  4126.      5) The lead byte table contains pairs of bytes that represent the
  4127.         inclusive boundary values for the lead bytes of the specified
  4128.         alphabet.  Because of the way bytes are ordered by the 8086
  4129.         microprocessor family, the values must be read as byte values,
  4130.         not as word values.
  4131.      6) If the interim console flag is set (DL=0001h) by a program
  4132.         through a call to fn 63h, the following int 21h functions
  4133.         return interim character information on request: 07h, 08h,
  4134.         0Bh, 0Ch.
  4135.  
  4136.  
  4137. Function  64h   Undocumented - Used internally by DOS
  4138. entry   AH      64h
  4139. return  unknown
  4140. note 1) DOS 3.2+ internal function of some type? May be a network
  4141.         function.
  4142.      2) In DOS 3.31 it seems that when you load AL with a nonzero
  4143.         number, int 28h will get called more often.  AL=0 resets back
  4144.         to the default "boot up" state.
  4145.  
  4146.  
  4147. Function  65h   Get Extended Country Information (DOS 3.3+)
  4148.                 Returns information about the selected country
  4149.                 formats, code pages, and conversion tables
  4150. entry   AH      65h
  4151.         AL      information ID code
  4152.                 01h     get general internationalization info
  4153.                 02h     get pointer to uppercase table (130 bytes max)
  4154.                         (maps chars 80h-0FFh to their uppercase
  4155.                          equivalents, if any; used mainly to map
  4156.                          accented or other vowels to the corresponding
  4157.                          plain vowels)
  4158.                 03h     unknown
  4159.                 04h     get pointer to filename uppercase table (130
  4160.                         bytes max) (similar to table for AL = 02h)
  4161.    (DOS 5.0+)   05h     get filename character table - specifies which
  4162.                         chars must not be used in filenames.
  4163.                 06h     get pointer to collating sequence table (258
  4164.                         bytes max)  (maps uppercase, lower, and
  4165.                         accented chars together for sorting)
  4166.                 07h     get pointer to double-byte character set table
  4167.    (DOS 5.0+)   20h     convert character - converts character in DL to
  4168.                         uppercase using the current uppercase table
  4169.    (DOS 5.0+)   21h     convert string - converts string in DS:DX,
  4170.                         length CX to uppercase using current uppercase
  4171.                         table, returns in DS:DX
  4172.    (DOS 5.0+)   22h     convert ASCIIZ string - converts string in
  4173.                         DS:DX to uppercase using current uppercase
  4174.                         table, returns in DS:DX
  4175.  
  4176.         BX      code page (0FFFFh = current code page)
  4177.         CX      amount of information to be returned (minimum 5)
  4178.         DX      target country ID (0FFFFh = default current country)
  4179.         ES:DI   segment/offset pointer to country information buffer
  4180. return  CF      set on error
  4181.                 AX      error code (02h)
  4182.                         otherwise:
  4183.         CX      size of country information returned
  4184.         ES:DI   pointer to country information:
  4185.               offset   length   description
  4186.                 00h   1 byte    info ID  (for all following buffers)
  4187.         If information ID code <> 1:
  4188.                 01h     dword  pointer to information
  4189.         If information ID code = 1:
  4190.                 01h     word    length of remainder of buffer (<= 38)
  4191.                 03h     word    country ID
  4192.                 05h     word    code page number
  4193.                 07h  34 bytes   same as for int 21h function 38h
  4194.         If information ID code = 2:
  4195.                 01h     word    table size
  4196.                 05h     dword   pointer to uppercase table
  4197.             128 bytes uppercase equivalents (if any) of chars 80h-0FFh
  4198.         If information ID code = 4:
  4199.                 01h     word    table size
  4200.                 05h     dword   pointer to collating table
  4201.             256 bytes   values used to sort characters 00h-0FFh
  4202.         If information ID code = 6:
  4203.                 01h     word    table size
  4204.                 05h     dword   pointer to filename uppercase table.
  4205.                                 This table starts with a 2-byte length
  4206.                                 field, then 256 ASCII values placed in
  4207.                                 order
  4208.             128 bytes   uppercase equivalents (if any) of chars
  4209.                         80h-0FFh
  4210.         If information ID code = 7: (DOS 4.0)
  4211.                 unknown
  4212. note 1) For AL=02h, 04h, or 06h, the first two bytes of the table
  4213.         give its length and then a 128 byte table of uppercase ASCII
  4214.         characters for 02h or 04h and a pointer to the collating
  4215.         sequence for 06h.
  4216.      2) The country code and code page must match.  If not, error 02h
  4217.         is in AX.
  4218.      3) If more information is provided than was requested by CX, it
  4219.         is truncated without generating an error.
  4220.      4) Country information:
  4221.         bytes   description
  4222.         01h     value of AL (01h)
  4223.         02h,03h size (max = 38)
  4224.         04h,05h country code
  4225.         06h,07h code page
  4226.         08h,09h date format
  4227.         0Ah,0Eh currency symbol
  4228.         0Fh,10h thousands separator
  4229.         11h,12h decimal separator
  4230.         13h,14h date separator
  4231.         15h,16h time separator
  4232.         17h     currency format flags
  4233.         18h     digits in currency
  4234.         19h     time format
  4235.         20h-22h monocase routine entry point
  4236.         23h-24h data list separator
  4237.         25h-29h zeros
  4238.  
  4239.  
  4240. Function  66h   Get/Set Global Code Page Table (DOS 3.3+)
  4241.                 Query/reset code page defaults
  4242. entry   AH      66h
  4243.         AL      00h     Get Global Code Page
  4244.                 01h     Set Global Page
  4245.                         BX      active code page
  4246.                         DX      system code page
  4247.                                 (active page at boot time)
  4248. return  CF      clear  successful
  4249.                 set    AX       error code (unknown)
  4250.         if 00h         BX       active code page
  4251.                        DX       system code page
  4252.                                 (active page at boot time)
  4253. note 1) BX = active code page: 437 = US, 860 = Portugal, 863 = Canada
  4254.                                (French) 865 = Norway/Denmark, 850 =
  4255.                                multilingual
  4256.      2) MS 5.0 TR shows fns as 01h and 02h.
  4257.  
  4258.  
  4259. Function  67h   Set Handle Count  (DOS 3.3+)
  4260.                 Supports more than 20 open files per process
  4261. entry   AH      67h
  4262.         BX      desired number of handles (20 to 65,535)
  4263. return  CF      clear   if OK
  4264.                 set     if error
  4265.                 AX      error code (unknown)
  4266. note 1) This function changes the 20-byte handle table pointer in the
  4267.         PSP to point to a new, larger handle table elsewhere in memory.
  4268.      2) The memory the 67h call allocates is taken from the normal
  4269.         DOS pool, and is reclaimed on process termination, so nothing
  4270.         is lost.
  4271.      3) When calling this function you must release enough memory for
  4272.         DOS to contain the extended handle list.
  4273.      4) If the requested number of handles is less than 20 nothing
  4274.         is done.
  4275.      5) Early versions of PC-MOS/386 v4.1 did not properly deallocate
  4276.         memory when the number of handles was reduced.
  4277.      6) The error value returned in AX is not documented in the IBM
  4278.         4.0 DOS Technical Reference, the MSDOS Encyclopedia or the MS
  4279.         5.0 TR.
  4280.      7) For PC-MOS/386 4.x, the only error code is 08h (insufficient
  4281.         memory).
  4282.  
  4283.  
  4284. Function  68h   Commit File (DOS 3.3+)
  4285.                 Write all buffered data to disk
  4286. entry   AH      68h
  4287.         BX      file handle of previously opened file
  4288. return  CF      clear   successful
  4289.                 set     on error
  4290.                         AX      error code (unknown)
  4291. note 1) Faster and more secure method of closing a file in a network
  4292.         than current close commands.
  4293.      2) This is effectively the same as DUPing the handle for a file
  4294.         and then closing the new one, except that this call won't fail
  4295.         if the system is out of handles.
  4296.      3) The file's buffers are flushed and its directory and FAT
  4297.         entries are updated.
  4298.      4) The error value returned in AX is not documented in the IBM
  4299.         4.0 DOS Technical Reference, the MSDOS Encyclopedia or the MS
  4300.         5.0 TR.
  4301.      5) For PC-MOS/386 4.x, the error codes are 06h (invalid handle)
  4302.         and 22h (wrong disk).
  4303.  
  4304.  
  4305. Function  69h   Disk Serial Number  DOS 4.0+ (US versions)
  4306.                 Handles "Volume Serial Number" on disks formatted with
  4307.                 DOS 4.0+
  4308. entry   AH      69h     Get Volume Serial Number
  4309.         AL      00h     get serial number
  4310.                 01h     set serial number
  4311.         BL      drive (0=default, 1=A, etc)
  4312.         DS:DX   pointer to disk information table
  4313. return  CF      set     on error
  4314.                 AX      error code
  4315.                 clear   if successful
  4316.                 AH      destroyed
  4317.                 AL      (fn 00h) buffer filled with appropriate values
  4318.                                  from extended BPB
  4319.                         (fn 01h) extended BPB on disk set to values
  4320.                                  from buffer
  4321.         DS:DX   disk information table. Format:
  4322.                 offset  size    description
  4323.                 00h     word    unknown (zeroes on my system)
  4324.                 02h    dword    disk serial number (binary)
  4325.                 06h 11 bytes    volume label or "NO NAME    " if none
  4326.                 11h  8 bytes    FAT type - string "FAT12   " or
  4327.                                 "FAT16   "
  4328. note 1) The FAT type field refers to the number of bits per directory
  4329.         entry.
  4330.      2) Does not generate a critical error; all errors are returned
  4331.         in AX.
  4332.      3) Error 0005h given if no extended BPB on disk.
  4333.      4) Does not work on network drives (error 0001h).
  4334.      5) Buffer after first two bytes is exact copy of bytes 27h thru
  4335.         3Dh of extended BPB on disk.
  4336.      6) FORMAT (in DOS 5.0) does not call int 21h/fn 69h. (Get/Set 
  4337.         Volume Serial Number)  For floppy disks, it calls int 21h/fn 
  4338.         440Dh, CH=08, CL=46 [Set Media ID], and passes the serial 
  4339.         number.   (from dsparks, BIX) 
  4340.  
  4341.  
  4342. Function  6Ah   Unknown  (DOS 4.0?)
  4343.  
  4344.  
  4345. Function  6Bh   Unknown  (DOS 4.0?)
  4346.  
  4347.  
  4348. Function  6Ch   Extended Open/Create  DOS 4.0+ (US)
  4349.                 Combines functions available with Open, Create, Create
  4350.                 New, and Commit File
  4351. entry   AH      6Ch
  4352.         AL      00h  reserved  [which means there might be other
  4353.                                 subfunctions?]
  4354.         BX      mode    format  0WF0 0000 ISSS 0AAA
  4355.                                 AAA is access code (read, write,
  4356.                                                     read/write)
  4357.                                 SSS is sharing mode
  4358.                                 I       0       pass handle to child
  4359.                                         1       no inherit [interesting!]
  4360.                                 F       0       use int 24h for errors
  4361.                                         1       disable int 24h for all
  4362.                                                 I/O on this handle; use
  4363.                                                 own error routine
  4364.                                 W       0       no commit
  4365.                                         1       auto commit on all writes
  4366.         CX      create attribute
  4367.            bits 0       read only
  4368.                 1       hidden
  4369.                 2       system
  4370.                 3       volume label
  4371.                 4       reserved
  4372.                 5       archive
  4373.                 6-15    reserved
  4374.         DH      00h (reserved)
  4375.         DL      action if file exists/does not exists
  4376.            bits 0-3     action if file exists
  4377.                         0000    fail
  4378.                         0001    open
  4379.                         0010    replace/open
  4380.                 4-7     action if file does not exist
  4381.                         0000    fail
  4382.                         0001    create
  4383.         DS:SI   pointer to ASCIIZ file name
  4384. return  CF      set on error
  4385.                 AX      error code (unknown)
  4386.                 clear
  4387.                 AX      file handle
  4388.                 CX      action taken
  4389.                         01h     file opened
  4390.                         02h     file created/opened
  4391.                         03h     file replaced/opened
  4392. note    When APPEND is installed, if DX=xx1x it looks only in current
  4393.         directory, if DX=xx0x it will search the full append path.
  4394.         DX is called the open flag and gives what action to take if
  4395.         the file exists or does not exist.
  4396.  
  4397.  
  4398. Function  89h   undocumented - DOS_Sleep
  4399.  *              Not documented by Microsoft
  4400. entry   AH      89h
  4401. return  unknown
  4402. note 1) Function included in Microsoft C 4.0 startup code MSDOS.INC.
  4403.      2) Debugging shows that the first instruction on entry to DOS
  4404.         compares AH with 64h (at least in DOS 3.2) and aborts the
  4405.         call if AH > 64.
  4406.      3) Possibly used in European MSDOS 4.0?
  4407.  
  4408.  
  4409.  
  4410. Aftermarket Application Installed Function Calls:
  4411.  
  4412. Novell Netware 2.11:
  4413.         Novell no longer recommends the int 21h method for invoking
  4414.         the Netware functions.  Int 21h will be supported
  4415.         indefinitely, but the new net API calls for addressing the
  4416.         software through the Multiplex Interrupt (2Fh).  You may
  4417.         address the API through int 2Fh in the same manner as int 21h;
  4418.         only the interrupt number is different.
  4419.  
  4420.         Novell API calls are referenced in Chapter 13.  Most functions
  4421.         from 0B6h through 0F9h are preempted by NetWare; if your
  4422.         software uses any of these calls for another purpose it will
  4423.         likely not run under NetWare.
  4424.  
  4425. NOTE:   Novell (and most others') network software and SoftLogic's
  4426.         DoubleDOS conflict on the following int 21h functions
  4427.         0EAh-0EEh.  Netware must use int 2Fh functions instead of 21h
  4428.         functions if DoubleDOS will be used on the network.
  4429.  
  4430.  
  4431. Functions 0E0h - 0F6h: used by AI Architects/Ergo Computing
  4432.           DOS extender
  4433.  
  4434.  
  4435. Functions 0E4h - 0EEh: used by DoubleDOS task switcher
  4436.  
  4437.  
  4438. Function  0FEh  Enable Reader v4.0 API
  4439.                 Enable Reader is a speech synthesizer interface for
  4440.                 the blind.  It will save all registers except the
  4441.                 flags, where the zero flag will be set if the call was
  4442.                 not one of the available Enable Reader 4.0 functions.
  4443.  
  4444. entry   AH      0FEh
  4445.         AL      01h     Driver Output
  4446.         DL      Character To Output
  4447. return  none
  4448. note    The Driver Output call will output the character in DL through
  4449.         the Enable Reader driver, without turning off the Help
  4450.         Functions.  It will be filtered by the ASCII sort routine in
  4451.         the Enable Reader Driver, and if it is punctuation it will be
  4452.         sent according to the level of punctuation selected.
  4453.  
  4454. entry   AH      0FEh
  4455.         AL      02h     Direct Output
  4456.         DL      ASCII character to output
  4457. return  none
  4458. note    The Direct Output call will send the byte in DL directly to
  4459.         the synthesizer, bypassing the Enable Reader driver and ASCII
  4460.         filter sort routine.
  4461.  
  4462. entry   AH      0FEh
  4463.         AL      03h     Message Output
  4464.         DL      character to output
  4465. return  none
  4466. note    The Message Output call allows character filtration and
  4467.         punctuation, but turns off the Help functions in the driver.
  4468.  
  4469. entry   AH      0FEh
  4470.         AL      41h (ASCII A) Auto
  4471. return  none
  4472. note    The AUTO call turns the Spell mode on or off.
  4473.  
  4474. entry   AH      0FEh
  4475.         AL      4Eh (ASCII N) Punctuation Levels
  4476. return  none
  4477. note    This call selects one of five Punctuation Character Sets that
  4478.         can be accessed.  The fifth level is "Output Punctuation",
  4479.         which allows all ASCII characters to be sent to the synthesizer
  4480.         without being filtered or translated into the Enable Reader 4.0
  4481.         Punctuation Words.
  4482.  
  4483. entry   AH      0FEh
  4484.         AL      4Fh (ASCII O) Help Word Levels
  4485. return  none
  4486. note    The Help call selects one of four levels of help. By selecting
  4487.         "No Help" at the start of your program, you can use the other
  4488.         Help Functions without having them speak their prompts.
  4489.  
  4490. entry   AH      0FEh
  4491.         AL      51h (ASCII Q) Quit
  4492. return  none
  4493. note    This call will stop the synthesizer from speaking.
  4494.  
  4495. entry   AH      0FEh
  4496.         AL      5Ah (ASCII Z) Letter-to-Word Translator
  4497. return  none
  4498. note    This call turns the Letter-To-Word Translator on or off.
  4499.   For a discussion on the TRANSLATOR Function, read
  4500.  
  4501. entry   AH      0FEh
  4502.         AL      54h (ASCII T) Upper Case Identification
  4503. return  none
  4504. note    This call toggles identification of uppercase letters.
  4505.  
  4506. entry   AH      0FEh
  4507.         AL      56h (ASCII V) Video Output
  4508. return  none
  4509. note    The Video Output call toggles the output to the synthesizer
  4510.         from data that is printed on the video screen.
  4511.  
  4512.  
  4513. Function  0FFh  CED   (CJ Dunford's DOS macro and command-line editor)
  4514.                 CED installable commands
  4515. entry   AH      0FFh
  4516.         AL      00h     Add Installable Command
  4517.                 01h     Remove Installable Command
  4518.                 02h     Reserved, may be used to test for CED
  4519.                         installation
  4520.         BL      mode byte
  4521.             bit 0       callable from DOS prompt
  4522.                 1       callable from application
  4523.                 2-7     not used in public domain CED
  4524.         DS:SI   pointer to CR-terminated command name
  4525.         ES:DI   pointer to far routine entry point
  4526. return  CF      set on error
  4527.         AX      01h     invalid function
  4528.                 02h     command not found (subfunction 1 only)
  4529.                 08h     insufficient memory (subfunction 0 only)
  4530.                 0Eh     bad data (subfunction 0 only)
  4531.         AH      0FFh    if CED not installed
  4532. note 1) When PCED returns, AX and the flags are changed.  Other
  4533.         registers are preserved, except as noted.
  4534.  
  4535.